SHARE
TWEET

Untitled

a guest Apr 24th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2.     module.exports.run = async(bot, message, args) => {
  3.     const agree    = "✅";
  4.     const disagree = "❎";
  5.  
  6.  
  7.   if (message.mentions.users.size === 0){
  8.     return message.reply("❌ " + "| Por Favor Mencione o Membro Desejado!");
  9.   }
  10.  
  11.   let bankmember = message.guild.member(message.mentions.users.first());
  12.   if(!bankmember){
  13.     message.reply("❌ " + "| Este Usuário Esta Invalido!");
  14.   }
  15.  
  16.   if(!message.guild.member(bot.user).hasPermission("BAN_MEMBERS")){
  17.     return message.reply("❌ " + "| Você Tem Tem Permissão \"BAN_MEMBERS").catch(console.error);
  18.   }
  19.  
  20.   let msg = await message.channel.send("Vote Agora Faltam (10 Segundos)");
  21.   await msg.react(agree);
  22.   await msg.react(disagree);
  23.  
  24.   const reactions = await msg.awaitReactions(reaction => reaction.emoji.name === agree || reaction.emoji.name === disagree, {time: 10000});
  25.   msg.delete();
  26.  
  27.   var NO_Count = reactions.get(disagree).count;
  28.   var YES_Count = reactions.get(agree);
  29.  
  30.   if(YES_Count == undefined){
  31.     var YES_Count = 1;
  32.   }else{
  33.     var YES_Count = reactions.get(agree).count;
  34.   }
  35.  
  36.   var sumsum = new Discord.RichEmbed()
  37.  
  38.             .addField("Votos Encerrados:", "----------------------------------------\n" +
  39.                                           "Total votos (Não.): " + `${NO_Count-1}\n` +
  40.                                           "Total votos (Sim.): " + `${YES_Count-1}\n` +
  41.                                           "----------------------------------------\n" +
  42.                                           "NOTE: Votos Necessários Para Banir (3+)\n" +
  43.                                           "----------------------------------------", true)
  44.  
  45.             .setColor("0x#FF0000")
  46.  
  47.   await message.channel.send({embed: sumsum});
  48.  
  49.   if(YES_Count >= 4 && YES_Count > NO_Count){
  50.  
  51.     bankmember.ban().then(member => {
  52.       message.reply(`${member.user.username} Foi banido Com Sucesso!!`)
  53.     })
  54.   }else{
  55.  
  56.     message.channel.send("\n" + "Seguro..... Por Enquanto!?");
  57.   }
  58.  
  59. }
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