I tried to make a bulk delete command to my discord bot, but it doesn't work.
const args = message.content.slice(prefix.length).trim().split(/ +/g);
if(args[1] == 'bulkdelete') {
const deleteCount = parseInt(args[2], 10);
message.channel.bulkDelete(deleteCount || 100)
.then(() => message.reply('Removing messages'))
.catch(console.error);
}
When I try to use it, it returns an error.
TypeError: Object.entries(...).filter(...).flatMap is not a function
What am I doing wrong?