Facebook
From Crimson Crow, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 138
  1. st Discord = require("discord.js");
  2. const db = require("quick.db");
  3. module.exports.run = async (bot, message, args) => {
  4.   let prefix = (await db.fetch(`prefix_${message.guild.id}`)) || "!";
  5.   if (!message.member.hasPermission("KICK_MEMBERS")) {
  6.     const embed = new Discord.RichEmbed()
  7.       .setDescription("```Ne yazık ki bu komutu kullanmaya yetkin yok.```")
  8.       .setColor("BLACK");
  9.  
  10.     message.channel.send(embed);
  11.     return;
  12.   }
  13.  
  14.   let u = message.mentions.users.first();
  15.   if (!u) {
  16.     return message.channel.send(
  17.       new Discord.RichEmbed()
  18.         .setDescription("Lütfen sunucudan yasaklanacak kişiyi etiketleyiniz!")
  19.         .setColor("BLACK")
  20.         .setFooter(bot.user.username, bot.user.avatarURL)
  21.     );
  22.   }
  23.  
  24.   const embed = new Discord.RichEmbed()
  25.     .setColor("BLACK")
  26.     .setDescription(`${u} Adlı şahsın yasaklanmasını onaylıyor musunuz?`)
  27.     .setFooter(bot.user.username, bot.user.avatarURL);
  28.   message.channel.send(embed).then(async function(sentEmbed) {
  29.     const emojiArray = ["✅"];
  30.     const filter = (reaction, user) =>
  31.       emojiArray.includes(reaction.emoji.name) && user.id === message.author.id;
  32.     await sentEmbed.react(emojiArray[0]).catch(function() {});
  33.     var reactions = sentEmbed.createReactionCollector(filter, {
  34.       time: 30000
  35.     });
  36.     reactions.on("end", () => sentEmbed.edit("İşlem iptal oldu!"));
  37.     reactions.on("collect", async function(reaction) {
  38.       if (reaction.emoji.name === "✅") {
  39.         message.channel.send(
  40.           `İşlem onaylandı! ${u} adlı şahıs sunucudan yasaklandı!`
  41.         );
  42.  
  43.         message.guild.ban(u, 2);
  44.       }
  45.     });
  46.   });
  47. };
  48.  
  49. module.exports.conf = {
  50.   aliases: [],
  51.   permLevel: 2,
  52.   enabled: true,
  53.   guildOnly: true,
  54.   kategori: "moderasyon"
  55. };
  56.  
  57. module.exports.help = {
  58.   name: "ban",
  59.   description: "ban",
  60.   usage: "ban"
  61. };