SHARE
TWEET

Untitled

a guest Jul 24th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. client.on('message', async message =>{
  3.   var prefix = "+";
  4. const ms = require("ms");
  5. if (message.author.omar) return;
  6. if (!message.content.startsWith(prefix)) return;
  7. if(!message.channel.guild) return message.channel.send('').then(m => m.delete(5000));
  8. if(!message.guild.member(client.user).hasPermission("MANAGE_ROLES")) return message.reply("**I Don't Have `MANAGE_ROLES` Permission**").then(msg => msg.delete(6000))
  9. var command = message.content.split(" ")[0];
  10. command = command.slice(prefix.length);
  11. var args = message.content.split(" ").slice(1);
  12.     if(command == "mute") {
  13.     let tomute = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
  14.     if(!tomute) return message.reply("**mention the person :question:** ") .then(m => m.delete(5000));
  15.     if(tomute.hasPermission("MANAGE_MESSAGES"))return      message.channel.send('**Unfortunately you do not have authority** `MANAGE_MASSAGEES`');
  16.     let muterole = message.guild.roles.find(`name`, "Muted");
  17.     //start of create role
  18.     if(!muterole){
  19.       try{
  20.         muterole = await message.guild.createRole({
  21.           name: "Muted",
  22.           color: "#070000",
  23.           permissions:[]
  24.         })
  25.         message.guild.channels.forEach(async (channel, id) => {
  26.           await channel.overwritePermissions(muterole, {
  27.             SEND_MESSAGES: false,
  28.             ADD_REACTIONS: false,
  29.             SPEAK : false
  30.           });
  31.         });
  32.       }catch(e){
  33.         console.log(e.stack);
  34.       }
  35.     }
  36.     //end of create role
  37.     let mutetime = args[1];
  38.     if(!mutetime) return message.reply("**Please specify the time of Mute :question:**");
  39.  
  40.     await(tomute.addRole(muterole.id));
  41. message.reply(`<@${tomute.id}> **Done Give Mute And Time Mute** : ${ms(ms(mutetime))}`);
  42. setTimeout(function(){
  43.       tomute.removeRole(muterole.id);
  44.       message.channel.send(`<@${tomute.id}> **Time passed And Mute And duration Mute **:white_check_mark: `);
  45.     }, ms(mutetime));
  46.  
  47.  
  48.  
  49.   }
  50. if(command === `unmute`) {
  51.   if(!message.member.hasPermission("MANAGE_ROLES")) return message.channel.sendMessage("**I Don't Have `MANAGE_ROLES` Permission** ").then(m => m.delete(5000));
  52. if(!message.guild.member(client.user).hasPermission("MANAGE_ROLES")) return message.reply("**I Don't Have `MANAGE_ROLES` Permission**").then(msg => msg.delete(6000))
  53.  
  54.   let toMute = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
  55.   if(!toMute) return message.channel.sendMessage("**mention the person :question:** ");
  56.  
  57.   let role = message.guild.roles.find (r => r.name === "Muted");
  58.  
  59.   if(!role || !toMute.roles.has(role.id)) return message.channel.sendMessage("**Did not take this person Mute **:question:")
  60.  
  61.   await toMute.removeRole(role)
  62.   message.channel.sendMessage("**Successfully turning off  Someone has**:question: ");
  63.  
  64.   return;
  65.  
  66.   }
  67.  
  68. });
  69.  
  70.  
  71.  
  72. bannnnn
  73.  
  74.  
  75.  
  76.  
  77.  
  78. client.on('message', message => {
  79.     const prefix = "+";
  80.       if (message.author.kick) return;
  81.       if (!message.content.startsWith(prefix)) return;
  82.      
  83.       let command = message.content.split(" ")[0];
  84.       command = command.slice(prefix.length);
  85.      
  86.       let args = message.content.split(" ").slice(1);
  87.      
  88.       if (command == "kick") {
  89.                    if(!message.channel.guild) return;
  90.              
  91.       if(!message.guild.member(message.author).hasPermission("KICK_MEMBERS")) return message.reply("You Don't Have KICK_MEMBERS Permission").then(msg => msg.delete(5000));
  92.       if(!message.guild.member(client.user).hasPermission("KICK_MEMBERS")) return message.reply("I Don't Have KICK_Members Permission");
  93.       let user = message.mentions.users.first();
  94.       let reason = message.content.split(" ").slice(2).join(" ");
  95.      
  96.       if (message.mentions.users.size < 1) return message.reply("**mention the person :question: **");
  97.       if(!reason) return message.reply ("**Type the reason for the Kick :question:**");
  98.       if (!message.guild.member(user)
  99.       .bannable) return message.reply("**I can not expel anyone higher than my rank :question:**");
  100.      
  101.       message.guild.member(user).kick(7, user);
  102.      
  103.       const banembed = new Discord.RichEmbed()
  104.       .setAuthor('Kicked !', user.displayAvatarURL)
  105.       .setColor("RANDOM")
  106.       .setTimestamp()
  107.       .addField("User:",  `[ + ${user.tag} + ]`)
  108.       .addField("By:", `[  + ${message.author.tag} +  ]`)
  109.       .addField("Reason:", `[ + ${reason} +  ]`)
  110.       client.channels.get("").send({embed : banembed})
  111.     }
  112.     });
  113.  
  114.  
  115.  
  116. client.on('message', message => {
  117.       if (message.author.x5bz) return;
  118.       if (!message.content.startsWith(prefix)) return;
  119.      
  120.       let command = message.content.split(" ")[0];
  121.       command = command.slice(prefix.length);
  122.      
  123.       let args = message.content.split(" ").slice(1);
  124.      
  125.       if (command == "ban") {
  126.                    if(!message.channel.guild) return message.reply('** This command only for servers**');
  127.              
  128.       if(!message.guild.member(message.author).hasPermission("BAN_MEMBERS")) return message.reply("**You Don't Have ` BAN_MEMBERS ` Permission**");
  129.       if(!message.guild.member(client.user).hasPermission("BAN_MEMBERS")) return message.reply("**I Don't Have ` BAN_MEMBERS ` Permission**");
  130.       let user = message.mentions.users.first();
  131.       let reason = message.content.split(" ").slice(2).join(" ");
  132.       /*let b5bzlog = clien
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