I'm trying to delete certain message with certain event like this:
await interaction.reply({ content: `content` })
.then(message => {
console.log(message);
client.on('messageDelete', async () => {
await message.delete();
});
});
But I get undefined in a console.log as a message. What is wrong? I already done the message delition with .then() and it worked, but now something is wrong. Maybe because it is reply, not just plain message?
You can delete a reply to an interaction by using deleteReply()
// Delete the reply to this interaction
interaction.deleteReply()
.then(console.log)
.catch(console.error);