Advertisement
Zi0lo

BAN

Jun 5th, 2020
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. const MessageEbmed = require("discord.js");
  3.  
  4. module.exports = {
  5. name: "ban",
  6. run: async (bot, message, args) => {
  7.  
  8. if(!message.member.hasPermission("BAN_MEMBERS")) {
  9. return message.reply(`nie masz uprawnień! Potrzebujesz permisji Banowanie członków!`)
  10. }
  11.  
  12. if(!message.guild.me.hasPermission("BAN_MEMBERS")) {
  13. return message.reply(`BOT nie ma uprawnień! BOT potrzebuje permisji Banowanie członków!`)
  14. }
  15.  
  16. if(!args[0]) {
  17. return message.reply(`oznacz użytkownika!`)
  18. }
  19.  
  20. let osobadobana = message.guild.member(message.mentions.users.first());
  21.  
  22. if(!osobadobana) {
  23. return message.reply(`nie znaleziono użytkownika!`)
  24. }
  25.  
  26. if(osobadobana.hasPermission("MANAGE_MESSAGES")) {
  27. return message.reply(`oznaczona osoba nie może zostać zbanowana!`)
  28. }
  29.  
  30. if(!args[1]) {
  31. return message.reply(`wpisz powód`)
  32. }
  33.  
  34. const powod = args.split(1).join(" ");
  35.  
  36. const embed = new Discord.MessageEmbed()
  37. .setTitle(`BAN!`)
  38. .setDescription(`${osobadobana} została permantentnie zbanowana przez <@${message.author.id}>
  39.  
  40. Powód: ${powod}`)
  41. .setFooter(`Przestrzegaj regulamin, bo inaczej następny będziesz Ty!`)
  42. message.channel.send(embed)
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement