Advertisement
karobloxYT

Untitled

Feb 14th, 2020
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. const { RichEmbed } = require("discord.js");
  2.  
  3.  
  4. module.exports = {
  5. name: "clear",
  6. category: "moderation",
  7. description: "Clears amount of messages",
  8. usage: "<amount>",
  9. run: async(client, message, args) => {
  10.  
  11. if(isNaN(args[0])) return message.channel.send("Please input a valid number!");
  12. if(args[0] > 101) return message.channel.send("I can only delete max 100 messages at a time!");
  13.  
  14. message.channel.bulkDelete(args[0]).then(messages => message.channel.send(`**Successfuly deleted ${messages.size} of ${args[0]}**`));
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement