Advertisement
Ryyan

Untitled

Aug 5th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. if (command === "ban") {
  2.  
  3. if(!message.guild.me.hasPermission("BAN_MEMBERS")) return message.react('❌'), message.channel.send('I don\'t have permissions to ban members. please contact a server admin')
  4.  
  5.  
  6. if (!message.member.hasPermission("BAN_MEMBERS")) return message.react('❌'), message.channel.send('Sorry, but you don\'t have permission to ban members.')
  7.  
  8.  
  9.  
  10. let member = message.mentions.members.first()
  11. if (!member) return message.react('❌'), message.channel.send('Hey! you didn\'t mention a user.')
  12.  
  13.  
  14. if (!member.bannable)
  15. return message.react('❌'), message.channel.send('Sorry, but i cannot ban that user.')
  16.  
  17. let reason = args.slice(1).join(' ');
  18. if (!reason) reason = "no reason provided."
  19.  
  20.  
  21. member.send(`Hey, mate you\'ve been banned in ${message.guild.name} by ${message.author.tag} because: "${reason}" 🇫`);
  22. await delay(100); // 100 msec = 0.1 seconds
  23. member.ban(reason)
  24. message.channel.send(`${member} was successfully banned by ${message.author.tag} for: "${reason}", can we get a f in the chat?`)
  25. message.react('🇫'), message.react('✅')
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement