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
d.js toolkit
d.js toolkit2mo 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
treble/luna
treble/luna2mo ago
seems like you're replying somewhere already or deferring since you dont show your entire interationCreate, it is impossible to tell more
JuanS
JuanS2mo ago
https://sourceb.in/irud5uOVls @one hella gay wolvinny ❄ 🌈 this?
treble/luna
treble/luna2mo ago
please dont ping me, i will reply when i have time. Check if you have multiple listeners attached
JuanS
JuanS2mo ago
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' }
treble/luna
treble/luna2mo ago
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
JuanS
JuanS2mo ago
it's a bot file that I got on github for module exports some time ago it was milrato if I'm not mistaken
treble/luna
treble/luna2mo ago
dont just copy code not knowing what it does
JuanS
JuanS2mo ago
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)
treble/luna
treble/luna2mo ago
once you fix the dual listeners, remove that line of code its useless
JuanS
JuanS2mo ago
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); "
treble/luna
treble/luna2mo ago
you are deferring your reply you cant defer and show a modal it has to be one of both
JuanS
JuanS2mo ago
how can I fix it?
treble/luna
treble/luna2mo ago
by not deferring or deferring inside your command file for those that need deferring
JuanS
JuanS2mo ago
then I put in the partnership file " await interaction.deferReply({ ephemeral: false }).catch(() => {});" and I remove it in the interactionCreate part?
treble/luna
treble/luna2mo ago
inside your command file *for those that need deferring *
modals cannot be deferred
JuanS
JuanS2mo ago
ahhh so I remove "await interaction.deferRepl..." from the interactioncreate part
treble/luna
treble/luna2mo ago
basically
JuanS
JuanS2mo ago
Perfect, thanks so much