Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. exports.run = (client, message, args, tools) => {
  2.  
  3. // This epsode will cover purging messages from a channel.
  4.  
  5. // First, we need to fetch the amount of messages a user wants to purge, wtis will be stored in args[0]
  6. if (isNaN(args[0])) return message.channel.send ('**Please supply a valid amound of messages to purge**');
  7. //
  8. //
  9. if (args[0] >100) return message.channel.send ('**Please supply a valid number less than 100**');
  10. //
  11.  
  12. //
  13. message.channel.bulkDelete(args[0])
  14. .then ( messages => message.channel.send(`**Successfully deleted \`${messages.size}/${args[0]}\` messages**`).then( msg => msg.delete({ timeout: 10000})))
  15. .catch( error => message.channel.send(`**ERROR:** ${error.message} `));
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement