Created
August 25, 2020 16:56
-
-
Save VLTNOgithub/377b298f823d758e581861ee04773d21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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