CollectorFilter being skipped? (or some other problem with awaitMessageComponent)
(It's been a while since I have talked on this server) Hi.
So, I'm having a problem with responding to a user interaction involving two Select Menus, one after another.
Basically, what's happening in my code is as follows:
- The user enters the command, to which the program responds with a Select Menu with two options;
- After the user selects one of the options, that option is then saved to a MongoDB database, the message with the select menu gets edited and a new message with a new select menu is sent;
- This second Select Menu has six options, and the user must choose one of them.
And this is where the problem appears.
What is supposed to happen: the user selects one of the options, that option is saved to the MongoDB database, the message with the second select menu gets edited and a new text message is sent, asking the user to send a file (and after this, what is supposed to happen doesn't matter for this issue).
What actually happens: the user selects one of the options, that option is saved in the MongoDB database, the text message is sent in chat, but the message doesn't get edited, ending with a timeout error from the try ... catch.
Now, I don't know exactly what is causing this issue, or if it is some kind of new limitation with Discord or discord.js, so, if someone could help, I would be deeply appreciated!
I'll send the code as the first comment in this post.
6 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 OP- discord.js : v14.14.1
- node.js : v18.12.1
And now the code
try putting
fetchReply: true
in the interaction reply optionsCollector worked, but now a new problem appeared
So, for what I understood from this error, the interaction in line 28 of the "chooseServerType" file, it doesn't know what interaction I'm calling
But the lines above it did? Lines 17 and 20 worked
It stored the selection in the database
And the message updated
But it gave that error and did not send the text message
Wait, it gave me a new error now
"Interaction has already been acknowledged."
Ok, I figured it out
Had to change the "confirmation.update" lines in the chooseLanguage file to "interaction.editReply"
It works now (until a different error that I have further in this code thread? chain? whatever)
Thanks for the help, don't know why I didn't think about the fetchReply when I had seen that before
Closing this post