Fradix

Clear

Feb 22nd, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. client.on('message', msg => {
  2.   if (msg.author.bot) return;
  3.   if (!msg.content.startsWith(prefix)) return;
  4.   let command = msg.content.split(" ")[0];
  5.   command = command.slice(prefix.length);
  6.   let args = msg.content.split(" ").slice(1);
  7.     if(command === "clear") {
  8.         const emoji = client.emojis.find("name", "wastebasket")
  9.     let textxt = args.slice(0).join("");
  10.     if(msg.member.hasPermission("MANAGE_MESSAGES")) {
  11.     if (textxt == " ") {
  12.         msg.delete().then
  13.         msg.channel.bulkDelete(1000).then(m => m.delete(3000));
  14. } else {
  15.     msg.delete().then
  16.     msg.delete().then
  17.     msg.channel.bulkDelete(textxt);
  18.   msg.channel.send(`\`عدد الرسائل التي تم مسحها:   ${textxt}\``).then(m => m.delete(3000));
  19.         }    
  20.     }
  21. }
  22. });
Add Comment
Please, Sign In to add comment