I've been trying to edit my bot's reply but this error pops out:
Error [INTERACTION_NOT_REPLIED]: The reply to this interaction has not been sent or deferred.
Code:
client.on("interactionCreate", async interaction => {
if (!interaction.isCommand){
return
}
if (interaction.isButton()) {
if(interaction.customId === 'EDIT'){
interaction.editReply({
content: "You clicked the button.",
ephemeral: true
})
};
}
const { commandName, options } = interaction
if (commandName == "button"){
const AslashButton = new Discord.MessageActionRow().addComponents(
new Discord.MessageButton()
.setCustomId('EDIT')
.setLabel('Button')
.setStyle('PRIMARY')
.setDisabled(false)
);
interaction.reply({
content: "Button.",
components: [AslashButton],
ephemeral: true
})
};
})
I used deferReply but it replied 'TestB is thinking...'
How can I make the message deferred?
You can only use followUp after you defer or reply to an interaction, and also, please check for the intents.