Discord.js Error with my dropdown menu and button

Hello, i want to ahev every choice = command So : If I choice a option, he send me the command error : ❌ Une erreur est survenue.
No description
15 Replies
d.js toolkit
d.js toolkit2w 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!
treble/luna
treble/luna2w ago
and what is that error
d.js docs
d.js docs2w ago
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
Maitre Kobayashi
Maitre KobayashiOP2w ago
Hi, i have "error : ❌ Une erreur est survenue." (in french) I just need to understand for what my code here, dont work.
treble/luna
treble/luna2w ago
you actually need to log your errors its impossible to tell what your issue is otherwise and use a pastebin
Nick
Nick2w ago
Sorry to peep in but I think your actual interaction for the wait module is being faked as well? "await niveauxModule.execute(client, i);"
Maitre Kobayashi
Maitre KobayashiOP2w ago
Une erreur s'est produite : Error [InteractionNotReplied]: The reply to this interaction has not been sent or deferred. at StringSelectMenuInteraction.followUp (/home/container/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:276:64) at Object.reply (/home/container/KannaNiveauxV2/Commandes/CommandesSlash/Utilitaires/profil.js:171:46) at Object.execute (/home/container/KannaNiveauxV2/Commandes/CommandesSlash/Niveaux/classement-niveaux.js:174:23) at InteractionCollector.<anonymous> (/home/container/KannaNiveauxV2/Commandes/CommandesSlash/Utilitaires/profil.js:181:38) at InteractionCollector.emit (node:events:536:35) at InteractionCollector.emit (node:domain:489:12) at InteractionCollector.handleCollect (/home/container/node_modules/discord.js/src/structures/interfaces/Collector.js:133:14) at processTicksAndRejections (node:internal/process/task_queues:95:5) { code: 'InteractionNotReplied' } for my code ? okay !
treble/luna
treble/luna2w ago
you are following up before replying
Maitre Kobayashi
Maitre KobayashiOP2w ago
okay
Nick
Nick2w ago
Oh I see the issue, you're calling
i.followUp()
i.followUp()
on a component interaction without deferring first. If I recall correctly inside the uh "collector.on('collect')" defer the interaction with
await i.deferReply({ ephemeral: true });
await i.deferReply({ ephemeral: true });
d.js docs
d.js docs2w ago
The ephemeral option when replying to an interaction will be removed in v15
- {..., ephemeral: true}
+ {..., flags: MessageFlags.Ephemeral}
- {..., ephemeral: true}
+ {..., flags: MessageFlags.Ephemeral}
Read here on how to specify multiple flags
Nick
Nick2w ago
Ah Thank you Would he use flags instead then?
Maitre Kobayashi
Maitre KobayashiOP2w ago
I found the problem, thank you 😭 I felling bad for this :/
treble/luna
treble/luna2w ago
yes

Did you find this page helpful?