Reputation: 4881
I am writing my first Discord bot heavily based on the example code published at https://github.com/discord-net/Discord.Net/tree/dev/samples/InteractionFramework
I am attempting to add a SlashCommand as per
[SlashCommand("kavs", "This is a test.")]
public async Task GreetUserAsync()
{
await RespondAsync(text: $"the command has worked", ephemeral: true);
}
When the bot is running, the SlashCommand looks to have been registered as when I type a "/" I see the following
If I enter "/kavs" then I get the following error from the bot
On discord I see
Any ideas what I might be doing wrong?
Upvotes: 0
Views: 845
Reputation: 1018
It's beacause the InteractionModuleBase
class has an overload which requires a generic type.
I fixed the issue by replacing the module base class
: InteractionModuleBase<SocketInteractionContext<SocketSlashCommand>>
with
: InteractionModuleBase<SocketInteractionContext>
Upvotes: 2