Okay, I remember I did this before but, I quite can't remember what the code was.
I want the bot to check if the command's author has the role "Delete Masters". If not then it should give out the error "You don't have the required role!".
This is the code I currently have:
const amount = parseInt(args[2]) + 1;
if (isNaN(amount)) {
return msg.reply("that doesnt seem to be a valid number.");
} else if (amount <= 1 || amount > 100) {
return msg.reply("you need to input a number between 2 and 100.");
}
msg.channel.bulkDelete(amount, true).catch((err) => {
console.error(err);
msg.channel.send("there was an error trying to delete messages in this channel!");
});