SHARE
TWEET

Untitled

a guest Aug 22nd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2. const config = require("../config")
  3. module.exports = class purge {
  4.     constructor() {
  5.         this.name = 'purge'
  6.         this.alias = ['delete', 'purge', "p", 'clear'],
  7.         this.usage = `${config.prefix}purge`
  8.     }
  9. }
  10.  
  11. async run(client, message, args) {
  12.  
  13.     if(!message.guild.member(message.author).hasPermission('MANAGE_MESSAGES')) return message.channel.send('Vous n\'avez pas les permissions !');
  14.         if(!args.message.channel.bulkDelete(args[1]).then((messages) => {
  15.             if(!args[1] > 100) return message.channel.send(':warning: `merci d\'indiquer un nombre en dessous de 100`').catch(console.error);
  16.             message.channel.send(`**${messages.size}** messages ont été supprimés !`).catch(e => message.channel.send(`\`${e}\``));
  17.         }))
  18.  
  19.    
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top