Skip to content

Instantly share code, notes, and snippets.

@VLTNOgithub
Created August 25, 2020 16:56
Show Gist options
  • Save VLTNOgithub/377b298f823d758e581861ee04773d21 to your computer and use it in GitHub Desktop.
Save VLTNOgithub/377b298f823d758e581861ee04773d21 to your computer and use it in GitHub Desktop.
module.exports = {
name: 'clear',
description: "A clear command!",
execute(message, args){
const amount = parseInt(args[0]) + 1;
if(isNaN(amount)){
return message.reply('That is not a valid number');
} else if(amount <= 1 || amount > 100){
return message.reply('Please input a number between 1 and 99');
} else {
message.channel.bulkDelete(amount, true).catch(err => {
console.error(err);
message.channel.send('There was an error removing messages in this channel');
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment