Skip to content

Problem when making a discord bot

IceTapz :P

Asked Jan 19, 2019, 10:50 PM EST1 answer
Share
LinkedInX
Hi, so basically, I am trying to make a discord bot but it is not working due to the following line:
 
await CommandService.AddModulesAsync(Assembly.GetEntryAssembly());
 
The error that my compiler prompts is:
 
Severity Code Description Project File Line Suppression State
Error CS7036 There is no argument given that corresponds to the required formal parameter 'services' of 'CommandService.AddModulesAsync(Assembly, IServiceProvider)' Discord Bot C:\Users\*********\Desktop\Discord Bot\Discord Bot\Program.cs 37 Active
 
I will leave the code right above here (the line with error is 37):

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    I managed to solve the problem by changing it to this, I hope it works for you!

    await CommandService.AddModulesAsync(Assembly.GetEntryAssembly(), services: null);

    Note: I don't know if this will affect anything important in the long run but it might get rid of the error.
    0