DiscordAPIError: Interaction has already been acknowledged.

client.on('interactionCreate', async (interaction) => {
const split = interaction.customId.split("_")
const customfilter = split[0]
const userid = split[1]
const member = await interaction.guild.members.fetch(userid)
if (customfilter == 'userbannen') {

const embed = new MessageEmbed()
.setTitle('Erfolg!')
.setDescription('Ich habe den User gebannt')
.setColor('RED')

interaction.reply({ embeds: [embed], ephemeral: true })
member.ban()


}
client.on('interactionCreate', async (interaction) => {
const split = interaction.customId.split("_")
const customfilter = split[0]
const userid = split[1]
const member = await interaction.guild.members.fetch(userid)
if (customfilter == 'userbannen') {

const embed = new MessageEmbed()
.setTitle('Erfolg!')
.setDescription('Ich habe den User gebannt')
.setColor('RED')

interaction.reply({ embeds: [embed], ephemeral: true })
member.ban()


}
At this part of my code the Bot should reply to the interaction and also should ban the member (I got the id of the member in the interaction custom id) Error:
Unhandled promise rejection: DiscordAPIError: Interaction has already been acknowledged.
at RequestHandler.execute (C:\Users\freie\Desktop\Strandbots\nextmain\node_modules\discord.js\src\rest\RequestHandler.js:350:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (C:\Users\freie\Desktop\Strandbots\nextmain\node_modules\discord.js\src\rest\RequestHandler.js:51:14)
at async ButtonInteraction.reply (C:\Users\freie\Desktop\Strandbots\nextmain\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:103:5) {
method: 'post',
path: '/interactions/1063928874129444944/aW50ZXJhY3Rpb246MTA2MzkyODg3NDEyOTQ0NDk0NDpUY3gyMGplQnVLVGhPd09aMEFkVEhGdmg4ZmFFZlFHZ0NwSDg0OERIMXZ0a3ljalNYSThLcFR6ME83MklmQ3dhNlBWOWt4b0ptOTJnZkYzN09yc3Vtc2tMajN2a004bmZYYUZLZ0IyaHI1WmhOWDJWdmlucXFzRXBaVHF2YXJnRg/callback',
code: 40060,
httpStatus: 400,
requestData: { json: { type: 4, data: [Object] }, files: [] }
}
Unhandled promise rejection: DiscordAPIError: Interaction has already been acknowledged.
at RequestHandler.execute (C:\Users\freie\Desktop\Strandbots\nextmain\node_modules\discord.js\src\rest\RequestHandler.js:350:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (C:\Users\freie\Desktop\Strandbots\nextmain\node_modules\discord.js\src\rest\RequestHandler.js:51:14)
at async ButtonInteraction.reply (C:\Users\freie\Desktop\Strandbots\nextmain\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:103:5) {
method: 'post',
path: '/interactions/1063928874129444944/aW50ZXJhY3Rpb246MTA2MzkyODg3NDEyOTQ0NDk0NDpUY3gyMGplQnVLVGhPd09aMEFkVEhGdmg4ZmFFZlFHZ0NwSDg0OERIMXZ0a3ljalNYSThLcFR6ME83MklmQ3dhNlBWOWt4b0ptOTJnZkYzN09yc3Vtc2tMajN2a004bmZYYUZLZ0IyaHI1WmhOWDJWdmlucXFzRXBaVHF2YXJnRg/callback',
code: 40060,
httpStatus: 400,
requestData: { json: { type: 4, data: [Object] }, files: [] }
}
11 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs2y ago
Tag suggestion for @Bene: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 / buttons / select menus
Bene
BeneOP2y ago
Nope it hasn't already tried it
It's Manny
It's Manny2y ago
It has, that's the only way you get that error Check if you've deferred reply or have replied somewhere in your code
Bene
BeneOP2y ago
I didn't
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP2y ago
jup
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP2y ago
But what is the reply to the buttonclick then?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs2y ago
Suggestion for @Bene:guide Interactions: Responding to buttons read more
Want results from more Discord servers?
Add your server