Interaction already awknoledged

code:
case 'remove':
const name = interaction.options.getString('name')
const deleteSwitch = new EmbedBuilder()
.setColor('Red')
.setDescription(`Switch ${name} deletado.`)
.setThumbnail("https://rustlabs.com/img/items180/smart.switch.png")
interaction.reply({ embeds: [deleteSwitch] })
switchSchema.findOneAndDelete({ Switchs: name }, async (data) => {
if (!data) {
interaction.reply({ embeds: [no_data] })
} else if (data) {
data.save()
}
})
break;
case 'remove':
const name = interaction.options.getString('name')
const deleteSwitch = new EmbedBuilder()
.setColor('Red')
.setDescription(`Switch ${name} deletado.`)
.setThumbnail("https://rustlabs.com/img/items180/smart.switch.png")
interaction.reply({ embeds: [deleteSwitch] })
switchSchema.findOneAndDelete({ Switchs: name }, async (data) => {
if (!data) {
interaction.reply({ embeds: [no_data] })
} else if (data) {
data.save()
}
})
break;
3 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Yinoguns
Yinoguns2y ago
case 'remove':
const name = interaction.options.getString('name')
const deleteSwitch = new EmbedBuilder()
.setColor('Red')
.setDescription(`Switch ${name} deletado.`)
.setThumbnail("https://rustlabs.com/img/items180/smart.switch.png")
interaction.reply({ embeds: [deleteSwitch] });

switchSchema.findOneAndDelete({ Switchs: name }, async (data) => {
if (!data) {
interaction.reply({ embeds: [no_data] })
} else if (data) {
data.save()
}
})
break;
case 'remove':
const name = interaction.options.getString('name')
const deleteSwitch = new EmbedBuilder()
.setColor('Red')
.setDescription(`Switch ${name} deletado.`)
.setThumbnail("https://rustlabs.com/img/items180/smart.switch.png")
interaction.reply({ embeds: [deleteSwitch] });

switchSchema.findOneAndDelete({ Switchs: name }, async (data) => {
if (!data) {
interaction.reply({ embeds: [no_data] })
} else if (data) {
data.save()
}
})
break;
You have interaction.reply twice, that's the issue
Ashura
AshuraOP2y ago
kk , thank you
Want results from more Discord servers?
Add your server