Embed is only sending once every time the slash command is ran every active session
By every active session I mean every time the bot is online.
I have a slash command that is like an 8ball command. It isnt finished since this is inly the testing version but It only sends the embed once then if I run it a 2nd time it says "Application didn't respond" with no errors in the console.
Here is my code:
I've tried: Resetting my bot's token, only using interaction.reply
Maybe it is because the command has an option that is being un used?
13 Replies
- 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 OPYou have
client.once
, which is for the event to only be emitted once
You should use client.on
My copilot plugin adds stuff onto my code sometimes. Thank you for pointing that out!
Also do you know why sometimes the "yes, no, maybe" section is sometimes left blank? I assume it is because the number hasnt generated in time. Maybe I can get around that with have a boolean that is set to true when the number is generated and then check iof the bool is true and if it is then send the embed?
The only thing i can think of, is that the
randInt
function isn't returning any of those values you checkIt sometimes returns "yes"
I'm talking about the function itself, it may be returning something that isn't 0, 1 nor 2
the fix was adding a check AND updating the function. My subtraction was the opposite way around.
No more issues then?
Yep!
Alright 👍
Thank you!
No problem 😄, you can mark the thread as solved here