The reply to this interaction has already been sent or deferred.
Hi I have a problem. When I run the command "/partnership" "owner..." it gives me the error "Unhandled promise rejection: Error [INTERACTION_ALREADY_REPLIED]: The reply to this interaction has already been sent or deferred." on the string: await interaction.showModal(modal);
here is the complete code
https://sourceb.in/4sNvPn1yWI
19 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 OPseems like you're replying somewhere already
or deferring
since you dont show your entire interationCreate, it is impossible to tell more
https://sourceb.in/irud5uOVls
@one hella gay wolvinny ❄ 🌈 this?
please dont ping me, i will reply when i have time. Check if you have multiple listeners attached
Sorry about the ping. However I checked everything and there is nothing strange.
How can I fix it?
so?
Error showing modal: Error [INTERACTION_ALREADY_REPLIED]: The reply to this interaction has already been sent or deferred.
at CommandInteraction.deferReply (/home/container/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:59:46)
at Object.run (/home/container/SlashCommands/info/partnership.js:19:25)
at Client.<anonymous> (/home/container/events/interactionCreate.js:27:11)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[Symbol(code)]: 'INTERACTION_ALREADY_REPLIED'
}
also, what are you doing on line 23 there
you really shouldnt edit internal properties, let alone useless ones because interaction.member already is the guildmember
it's a bot file that I got on github for module exports some time ago
it was milrato if I'm not mistaken
dont just copy code not knowing what it does
Yes, you're right, but some time ago I didn't know what or how to do. But so far it hasn't had any problemsù
(sorry for my english, but I'm using the translator)
once you fix the dual listeners, remove that line of code
its useless
okok
ah
done https://sourceb.in/WjefpwYZxt
Unhandled promise rejection: Error [INTERACTION_ALREADY_REPLIED]: The reply to this interaction has already been sent or deferred.
at CommandInteraction.showModal (/home/container/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:244:46)
at Object.run (/home/container/SlashCommands/info/partnership.js:32:23)
at Client.<anonymous> (/home/container/events/interactionCreate.js:25:14)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[Symbol(code)]: 'INTERACTION_ALREADY_REPLIED'
}
interactionCreate.js:25
" cmd.run(client, interaction, args);"
partnership.js:32
" await interaction.showModal(modal);
"
you are deferring your reply
you cant defer and show a modal
it has to be one of both
how can I fix it?
by not deferring
or deferring inside your command file for those that need deferring
then I put in the partnership file " await interaction.deferReply({ ephemeral: false }).catch(() => {});" and I remove it in the interactionCreate part?
inside your command file *for those that need deferring *modals cannot be deferred
ahhh so I remove "await interaction.deferRepl..." from the interactioncreate part
basically
Perfect, thanks so much