Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.run = (client, message, args, tools) => {
- // This epsode will cover purging messages from a channel.
- // First, we need to fetch the amount of messages a user wants to purge, wtis will be stored in args[0]
- if (isNaN(args[0])) return message.channel.send ('**Please supply a valid amound of messages to purge**');
- //
- //
- if (args[0] >100) return message.channel.send ('**Please supply a valid number less than 100**');
- //
- //
- message.channel.bulkDelete(args[0])
- .then ( messages => message.channel.send(`**Successfully deleted \`${messages.size}/${args[0]}\` messages**`).then( msg => msg.delete({ timeout: 10000})))
- .catch( error => message.channel.send(`**ERROR:** ${error.message} `));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement