Skip to content
pls help me. how do i make a clean message command for my discord bot using node.js
Profile icon
Johnplayz1123

so i started making a bot for my discord server, i done all of the respond commands now i need is how to delete multiple messages for my bot, Pls help me

You are viewing a single comment. View All
Profile icon
alanchen12

You can use the bulk delete function that discord.js provides here.

Just fetch messages from a channel and bulk delete them.
Ex:

message.channel.messages.fetch({limit: AMOUNT OF MESSAGES}).then((messages) => {message.channel.bulkDelete(messages).catch(console.error)});