AFK Command buttons not working properly :(

here is my error code + my actual code is attched
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (C:\Users\conno\Desktop\miasma_\node_modules\@discordjs\rest\dist\index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\conno\Desktop\miasma_\node_modules\@discordjs\rest\dist\index.js:835:23)
at async _REST.request (C:\Users\conno\Desktop\miasma_\node_modules\@discordjs\rest\dist\index.js:1278:22)
at async ButtonInteraction.update (C:\Users\conno\Desktop\miasma_\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:236:5)
at async InteractionCollector.<anonymous> (C:\Users\conno\Desktop\miasma_\index.js:297:13) {
requestBody: {
files: [],
json: {
type: 7,
data: {
content: 'You will receive DMs when mentioned.',
tts: false,
nonce: undefined,
enforce_nonce: false,
embeds: undefined,
components: [],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined,
applied_tags: undefined,
poll: undefined
}
}
},
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1264108625820123191/aW50ZXJhY3Rpb246MTI2NDEwODYyNTgyMDEyMzE5MTo4c0ZnMEFXOUl6aU4wQ1dSeDR3WlZpQjBjdmlXMkxCSlpNTDVEd3pXWjEwWWhERzJYYUdYakhlN3RSRkxKRlZZQmVCb3A5SXZwanZEYzE5bXMyRElhWXRKdmN3ZGp6UzU4Y3VWZGtMdldhSUl6bTFtdmtEWXFhU3NIMDhlelh1cg/callback'
}

Node.js v20.15.0
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (C:\Users\conno\Desktop\miasma_\node_modules\@discordjs\rest\dist\index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\conno\Desktop\miasma_\node_modules\@discordjs\rest\dist\index.js:835:23)
at async _REST.request (C:\Users\conno\Desktop\miasma_\node_modules\@discordjs\rest\dist\index.js:1278:22)
at async ButtonInteraction.update (C:\Users\conno\Desktop\miasma_\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:236:5)
at async InteractionCollector.<anonymous> (C:\Users\conno\Desktop\miasma_\index.js:297:13) {
requestBody: {
files: [],
json: {
type: 7,
data: {
content: 'You will receive DMs when mentioned.',
tts: false,
nonce: undefined,
enforce_nonce: false,
embeds: undefined,
components: [],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined,
applied_tags: undefined,
poll: undefined
}
}
},
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1264108625820123191/aW50ZXJhY3Rpb246MTI2NDEwODYyNTgyMDEyMzE5MTo4c0ZnMEFXOUl6aU4wQ1dSeDR3WlZpQjBjdmlXMkxCSlpNTDVEd3pXWjEwWWhERzJYYUdYakhlN3RSRkxKRlZZQmVCb3A5SXZwanZEYzE5bXMyRElhWXRKdmN3ZGp6UzU4Y3VWZGtMdldhSUl6bTFtdmtEWXFhU3NIMDhlelh1cg/callback'
}

Node.js v20.15.0
4 Replies
d.js toolkit
d.js toolkitβ€’5mo 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
𝒄𝒐𝒏𝒏𝒐𝒓
i get the error when i click either button it detects afk command fine and when you come back or get pinged but the dm or not dm buttons bring up the error attached
ProTon⚑
ProTonβš‘β€’5mo ago
maybe it could be your interaction event having a function that replies before your collector replies
d.js docs
d.js docsβ€’5mo 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.
Want results from more Discord servers?
Add your server