Interaction already replied on slash command?

When the slash command is ran again, the old interaction is received (which is why it errors). How?
No description
No description
25 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
NyR
NyR3mo ago
Each call is separate, and each interaction is unique, if you only call that function when someone uses the command, then that shouldn't be the case, you may be replying to it somewhere else in your code, showing the full error might help
d.js docs
d.js docs3mo ago
- DiscordAPIError: Interaction has already been acknowledged - [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred. You have already replied to the interaction. - Use <Interaction>.followUp() to send a new message - If you deferred reply it's better to use <Interaction>.editReply() - Responding to slash commands / message components
Swyftey
Swyftey3mo ago
No description
Swyftey
Swyftey3mo ago
The function is only being called when the command is ran, or at least I think I'm using the same function for something else, too but that shouldn't matter?
Swyftey
Swyftey3mo ago
No description
Swyftey
Swyftey3mo ago
nvm i reread what you said, but still don't quite understand
NyR
NyR3mo ago
What is app.js line 22?
Swyftey
Swyftey3mo ago
It's the module for "app.post" let me show
Swyftey
Swyftey3mo ago
No description
Swyftey
Swyftey3mo ago
line 22 is the getResult function (action(request)) in the other script
NyR
NyR3mo ago
You maybe calling the same function on the same interaction twice somewhere, make sure you do not do that
Swyftey
Swyftey3mo ago
I'm not sure how
Swyftey
Swyftey3mo ago
No description
Swyftey
Swyftey3mo ago
kick player is the only command currently when you say "same function", do you mean app.post or the getResult function?
NyR
NyR3mo ago
either, both would produce the same result What would be '/result' post request? That would trigger the getResult everytime a post request is made to that endpoint, so that's not ideal
Swyftey
Swyftey3mo ago
Yes, but that /result post request should only be sent once like
Swyftey
Swyftey3mo ago
No description
Swyftey
Swyftey3mo ago
this is roblox it should only be sent once and then the express app post should end oh my god hold on nevermind
NyR
NyR3mo ago
You found your issue then?
Swyftey
Swyftey3mo ago
not yet but i'm trying something
NyR
NyR3mo ago
Hmm, then ig make sure you are not replying to the interaction somewhere else or calling the said function(s) more than once somewhere
Swyftey
Swyftey3mo ago
sadly nope alright is the .end() not correct? I see true, I could rename it
Swyftey
Swyftey3mo ago
app.post here has to do with the express webapp basically, the app.post function within the other script is supposed to create the connection and then remove it I'm positive. I even changed the names just now to try fixed it by not using a function to create that app.post event smh thanks