Ephemeral messages
My problem is that the error message is Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred. and not only DiscordAPIError[40060]: Interaction has already been recognized.
they happen because of my ephemeral messages, for example, I have a main message with several buttons, all buttons send messages from ephemeral, ephemeral messages have a couple more buttons, for example, to scroll through the rules pages, if I scroll to some and close the ephemeral message that is visible only to me. The next time you open it, it will give you similar errors, is there any way to fix this?
16 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!show your code
I can send the file in the format.js, many lines
ok!
it seems to have been published https://pastebin.com/zMegmhvN
Pastebin
123.js - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
The code in most spaghetti:akpopKrinj:
If you are waiting for button or select menu input from a specific message, don't create the collector on the channel.
- Channel collectors return component interactions for any component within that channel.
Thank you, this solved the problem when switching pages, sorry, but what about modal forms? they also have such errors when sending
Do you know what this might be related to?:Frogroll:
No, unfortunately it didn't help. After launching the bot, I send a modal form from one discord account, everything is fine with it and there are no errors in the process, but if someone decides to send another modal form after me, the bot will crash
By issuing errors in the console
DiscordAPIError[40060]: Interaction has already been acknowledged.
DiscordAPIError[10062]: Unknown interaction
I think I fixed it in the handler.
console.log gives out the id of the person who interacts every time, but the problem remains the same, when someone second after me starts interacting, the bot crashes
Thats gonna cause more issues, and is the reason you encounter your issue
You can't nest listeners
:method: ButtonInteraction#awaitModalSubmit()
@14.16.3
Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
Use that
It seems to me that I am doing something wrong, I entered your code into mine, logs in the console that the modal form has been sent, but still issues errors when users send this modal form after me, the error pops up when the 2nd user sends, and if the 3rd sends, then the bot will crash
console =>
Show your code
Pastebin
123.js - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
so no, you are not using what i told you
Not correctly at least
.