I followed this tutorial ( https://www.youtube.com/watch?v=ccsf5Rcu9mM ) on how to make a discord bot in C#
. Everything went fine until the 57:02 timestamp (the last step before getting it done). I get an error in the following line of code: await commands.AddModulesAsync(Assembly.GetEntryAssembly());
. It tells me that the argument is incorrect. VS suggest me to use AddModuleAsync()
instead of AddModulesAsync()
, but then it throws another error related to the arguments.
By the way, the only thing that isn't as in the tutorial is that I seem to have .Net Core 3.0
instead of 2.0 as in the video.
In latest stable version of Discord.net signature changed. Now you need add
IServiceProvider
as second argument. So you code must look like thisawait commands.AddModulesAsync(Assembly.GetEntryAssembly(), _services);
Where
_services
isIServiceProvider
;