C
C#2y 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
pip2y 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
REAPER2y ago
Do you mean like this?
pip
pip2y ago
ye
REAPER
REAPER2y 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
pip2y ago
what framework are u using, dsharpplus or discord.net? add this to your DiscordSocketConfig if discord.net
UseInteractionSnowflakeDate = false
UseInteractionSnowflakeDate = false
REAPER
REAPER2y ago
It worked rooHappy Thanks a lot
pip
pip2y ago
./close
Accord
Accord2y ago
✅ This post has been marked as answered!
Want results from more Discord servers?
Add your server
More Posts