C
C#3y ago
REAPER

Slash Command works but gives error? [Answered]

Hi, I'm trying to make a Discord Bot in .Net 6 and my Slash Command works but after the command it gives the user a hidden message saying "Application didn't answer". This is kind of annoying and I don't know why it's saying that when the Task was completed rooThink
8 Replies
pip
pip3y ago
you have to respond to the interaction using RespondAsync wherever you're processing the logic for the command, whether that be in an interactionhandler class or via the slashcommandexecuted event interaction.RespondAsync("pong");
REAPER
REAPEROP3y ago
Do you mean like this?
pip
pip3y ago
ye
REAPER
REAPEROP3y ago
Then I get this error: App Command System.TimeoutException: Cannot respond to an interaction after 3 seconds! at Discord.WebSocket.SocketCommandBase.RespondAsync(String text, Embed[] embeds, Boolean isTTS, Boolean ephemeral, AllowedMentions allowedMentions, MessageComponent components, Embed embed, RequestOptions options) at Discord.WebSocket.SocketInteraction.Discord.IDiscordInteraction.RespondAsync(String text, Embed[] embeds, Boolean isTTS, Boolean ephemeral, AllowedMentions allowedMentions, MessageComponent components, Embed embed, RequestOptions options) at Discord.Interactions.InteractionModuleBase`1.RespondAsync(String text, Embed[] embeds, Boolean isTTS, Boolean ephemeral, AllowedMentions allowedMentions, RequestOptions options, MessageComponent components, Embed embed)
pip
pip3y ago
what framework are u using, dsharpplus or discord.net? add this to your DiscordSocketConfig if discord.net
UseInteractionSnowflakeDate = false
UseInteractionSnowflakeDate = false
REAPER
REAPEROP3y ago
It worked rooHappy Thanks a lot
pip
pip3y ago
./close
Accord
Accord3y ago
✅ This post has been marked as answered!
Want results from more Discord servers?
Add your server