code not working anymore, giving interaction failed

Hello, I hope someone can help me. I have developed a verification bot challenging myself and building something totally customized, basically once a user starts the verification, the bot sends an ephemeral embed with a picture and a dropdown menu (with 5 choices) and the user must answer before the time elapsed or will get a failure attempt, if a total o 3 failures (due to the timeout or wrong answer or a mix of both) will be reached then the user is kicked, otherwise if the user answer correctly then the "not-verified" role will be removed and a "verified" role will be assigned; plus, the same user can't start more than once a verification, if he/she try a message will appear. The bot has been developed at the beginning of this year and officially deployed at the beginning of March but during this last period (don't know exactly from when) I discovered that isn't working anymore and whenever a user select any answer (doesn't matter if it's the correct one or the wrong ones), after few seconds the red text "this interaction failed" on Discord appears even tho before, as I already said, was working like a charm.
4 Replies
d.js toolkit
d.js toolkit7mo 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
Deeval
Deeval7mo ago
I tried to use a try-catch block (the try has been inserted immediately afterward the async execute(interaction, client) string) to see if about any error was detected, but nothing appeared on the console. I did also some other tests inserting some console.logs here and there and it seems for some reason the bot is "unable" to processing the task inside the collector.on('collect', async (i) (I just put a console.log afterward and doesn't show up on the console); to verify my theory I also tried to move the verificationMap.set(interaction.user.id, true); inside the collector between line 102 and 103 and if I try to start another verification during an already ongoing verification, instead to have a response according to line 78 (meaning a test is already running) it simply starts another verification having a total of 2 embeds with a dropdown menu each one. The strange thing is that everything works with collector.on('end', because I receive the message with the timeout. So just to recap: it seems like there is something weird with the collector but I don't understand what it could be and any kind of help will be highly appreciate. This is the code of my verification bot: https://pastebin.com/WaZcFVaP
Pastebin
const { ActionRowBuilder, EmbedBuilder, StringSelectMenuBu...
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.
treble/luna
treble/luna7mo ago
pass in fetchReply:true when replying collectors dont work without that
Deeval
Deeval7mo ago
so how exactly do I have to apply the fetchReply:true ? do I have to put it inside the interaction.update? ok, I just found the answer on the discord.js guide website 😅 yep, it seems working again now tank you very much 🙂, this can be marked as solved