Facebook
From Mercy, 2 Days ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 31
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3.  
  4. exports.run = (client, message, args) => {
  5.   if (!message.guild) {
  6.   const ozelmesajuyari = new Discord.RichEmbed()
  7.   .setColor(0xFF0000)
  8.   .setTimestamp()
  9.   .setAuthor(message.author.username, message.author.avatarURL)
  10.   .addField(':warning: Uyar─▒ :warning:', '`ban` adl─▒ komutu ├Âzel mesajlarda kullanamazs─▒n.')
  11.   return message.author.sendEmbed(ozelmesajuyari); }
  12.   let guild = message.guild
  13.   let reason = args.slice(1).join(' ');
  14.   let user = message.mentions.users.first();
  15.   let modlog = guild.channels.find('name', 'mod-log');
  16.   if (!modlog) return message.reply('`mod-log` kanal─▒n─▒ bulam─▒yorum.');
  17.   if (reason.length < 1) return message.reply('Ban sebebini yazmal─▒s─▒n.');
  18.   if (message.mentions.users.size < 1) return message.reply('Kimi banlayaca─č─▒n─▒ yazmal─▒s─▒n.').catch(console.error);
  19.  
  20.   if (!message.guild.member(user).bannable) return message.reply('Yetkilileri banlayamam.');
  21.   message.guild.ban(user, 2);
  22.  
  23.   const embed = new Discord.RichEmbed()
  24.     .setColor(0x00AE86)
  25.     .setTimestamp()
  26.     .addField('Eylem:', 'Ban')
  27.     .addField('Kullan─▒c─▒:', `${user.username}#${user.discriminator} (${user.id})`)
  28.     .addField('Yetkili:', `${message.author.username}#${message.author.discriminator}`)
  29.     .addField('Sebep', reason);
  30.   return guild.channels.get(modlog.id).sendEmbed(embed);
  31. };
  32.  
  33. exports.conf = {
  34.   enabled: true,
  35.   guildOnly: true,
  36.   aliases: [],
  37.   permLevel: 2
  38. };
  39.  
  40. exports.help = {
  41.   name: 'ban',
  42.   description: '─░stedi─činiz ki┼čiyi banlar.',
  43.   usage: 'ban [kullan─▒c─▒] [sebep]'
  44. };
  45.