discord api docs message delete code example
Example 1: how to send a message then delete it discord.js
message.reply('Invalid command')
.then(msg => {
msg.delete(10000)
})
Example 2: discordjs delete all messages in channel
// Bulk delete messages
channel.bulkDelete(5)
.then(messages => console.log(`Bulk deleted ${messages.size} messages`))
.catch(console.error);