Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(command === "purge") {
- const deleteCount = parseInt(args[0], 10);
- if(!deleteCount || deleteCount < 2 || deleteCount > 100)
- return message.reply("Please provide a number between 2 and 100 for the number of messages to delete");
- const fetched = await message.channel.fetchMessages({count: deleteCount});
- message.channel.bulkDelete(fetched)
- .catch(error => message.reply(`Couldn't delete messages because of: ${error}`));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement