Bot crashing after string gives role

My bot crashes when a user tries to select a role from my string menu options. It gives the roles then crashes, if they choose remove roles it just crashes. Anything would be appreciated:
11 Replies
d.js toolkit
d.js toolkit4w 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
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
Sincerely, alxx ᴬᴳ
one second sorry Error:
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:727:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:831:23)
at async _REST.request (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:1272:22)
at async StringSelectMenuInteraction.reply (C:\Users\alexe\AGU Bot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:115:5)
at async Client.<anonymous> (C:\Users\alexe\AGU Bot\src\colors.js:225:13) {
requestBody: { files: [], json: { type: 4, data: [Object] } },
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1304624064597459054/aW50ZXJhY3Rpb246MTMwNDYyNDA2NDU5NzQ1OTA1NDpiYVNudnphcDNLYXE4aEs4cDJIMUd2ajIzU1pSeGpXZllDVVlxNTREcVRld3VyUno0aHMzSWoyeXF3OExYSHhENUR5WjRPMVBRem1JOUNXZDh2VmZFR2FoSE91TUx2RnRCanY0ZGYxOHB1MTljNUFuZnRMYmMybDNma2EwSFp4Tg/callback'
}
node:events:497
throw er; // Unhandled 'error' event
^

Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
at StringSelectMenuInteraction.reply (C:\Users\alexe\AGU Bot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:105:46)
at Client.<anonymous> (C:\Users\alexe\AGU Bot\src\colors.js:228:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:402:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
code: 'InteractionAlreadyReplied'
}

Node.js v20.18.0
[nodemon] app crashed - waiting for file changes before starting...
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:727:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:831:23)
at async _REST.request (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:1272:22)
at async StringSelectMenuInteraction.reply (C:\Users\alexe\AGU Bot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:115:5)
at async Client.<anonymous> (C:\Users\alexe\AGU Bot\src\colors.js:225:13) {
requestBody: { files: [], json: { type: 4, data: [Object] } },
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1304624064597459054/aW50ZXJhY3Rpb246MTMwNDYyNDA2NDU5NzQ1OTA1NDpiYVNudnphcDNLYXE4aEs4cDJIMUd2ajIzU1pSeGpXZllDVVlxNTREcVRld3VyUno0aHMzSWoyeXF3OExYSHhENUR5WjRPMVBRem1JOUNXZDh2VmZFR2FoSE91TUx2RnRCanY0ZGYxOHB1MTljNUFuZnRMYmMybDNma2EwSFp4Tg/callback'
}
node:events:497
throw er; // Unhandled 'error' event
^

Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
at StringSelectMenuInteraction.reply (C:\Users\alexe\AGU Bot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:105:46)
at Client.<anonymous> (C:\Users\alexe\AGU Bot\src\colors.js:228:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:402:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
code: 'InteractionAlreadyReplied'
}

Node.js v20.18.0
[nodemon] app crashed - waiting for file changes before starting...
d.js docs
d.js docs4w ago
- DiscordAPIError: Interaction has already been acknowledged - [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred. You have already replied to the interaction. - Use <Interaction>.followUp() to send a new message - If you deferred reply it's better to use <Interaction>.editReply() - Responding to slash commands / message components
Sincerely, alxx ᴬᴳ
I have djs version 14.16 and I can't figure out what to do with debugging so wait
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
Sincerely, alxx ᴬᴳ
It says its already replied to here even though it's not in colors.js, its in roles.js:
at async Client.<anonymous> (C:\Users\alexe\AGU Bot\src\colors.js:225:13) {
at async Client.<anonymous> (C:\Users\alexe\AGU Bot\src\colors.js:225:13) {
and 225 has an interaction reply line 225* how would I fix that?
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
Sincerely, alxx ᴬᴳ
But the string menu is from the roles command which is in roles.js, so would I just delete the reply their then?
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
Sincerely, alxx ᴬᴳ
hm ty I'll look into it! i fixed it but now my interaction handler isnt working, giving the roles works but when I try to remove the roles it just says there was an error in my code and sends this into the console:
DiscordAPIError[50035]: Invalid Form Body
role_id[NUMBER_TYPE_COERCE]: Value "all" is not snowflake.
at handleErrors (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:727:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:1128:23)
at async SequentialHandler.queueRequest (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:959:14)
at async _REST.request (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:1272:22)
at async GuildMemberRoleManager.add (C:\Users\alexe\AGU Bot\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:131:7)
at async Client.<anonymous> (C:\Users\alexe\AGU Bot\src\roles.js:558:21) {
requestBody: { files: undefined, json: undefined },
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { role_id: [Object] }
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/guilds/1256302762157932655/members/1016447282176077925/roles/all'
}
DiscordAPIError[50035]: Invalid Form Body
role_id[NUMBER_TYPE_COERCE]: Value "all" is not snowflake.
at handleErrors (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:727:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:1128:23)
at async SequentialHandler.queueRequest (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:959:14)
at async _REST.request (C:\Users\alexe\AGU Bot\node_modules\@discordjs\rest\dist\index.js:1272:22)
at async GuildMemberRoleManager.add (C:\Users\alexe\AGU Bot\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:131:7)
at async Client.<anonymous> (C:\Users\alexe\AGU Bot\src\roles.js:558:21) {
requestBody: { files: undefined, json: undefined },
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { role_id: [Object] }
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/guilds/1256302762157932655/members/1016447282176077925/roles/all'
}
Want results from more Discord servers?
Add your server