text: const Discord = require('discord.js');
  const client = new Discord.Client();
  const ayarlar = require('./ayarlar.json');
  const chalk = require('chalk');
  const fs = require('fs');
  const moment = require('moment');
  require('./util/eventLoader')(client);
  
  var prefix = ayarlar.prefix;
  
  const log = message => {
    console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] ${message}`);
  };
  
  client.commands = new Discord.Collection();
  client.aliases = new Discord.Collection();
  fs.readdir('./komutlar/', (err, files) => {
    if (err) console.error(err);
    log(`${files.length} komut yüklenecek.`);
    files.forEach(f => {
      let props = require(`./komutlar/${f}`);
      log(`Yüklenen komut: ${props.help.name}.`);
      client.commands.set(props.help.name, props);
      props.conf.aliases.forEach(alias => {
        client.aliases.set(alias, props.help.name);
      });
    });
  });
  
  client.reload = command => {
    return new Promise((resolve, reject) => {
      try {
        delete require.cache[require.resolve(`./komutlar/${command}`)];
        let cmd = require(`./komutlar/${command}`);
        client.commands.delete(command);
        client.aliases.forEach((cmd, alias) => {
          if (cmd === command) client.aliases.delete(alias);
        });
        client.commands.set(command, cmd);
        cmd.conf.aliases.forEach(alias => {
          client.aliases.set(alias, cmd.help.name);
        });
        resolve();
      } catch (e){
        reject(e);
      }
    });
  };
  
  client.unload = command => {
    return new Promise((resolve, reject) => {
      try {
        delete require.cache[require.resolve(`./komutlar/${command}`)];
        let cmd = require(`./komutlar/${command}`);
        client.commands.delete(command);
        client.aliases.forEach((cmd, alias) => {
          if (cmd === command) client.aliases.delete(alias);
        });
        resolve();
      } catch (e){
        reject(e);
      }
    });
  };
  
  client.on('message', msg => {
    if (msg.content.toLowerCase() === 'sa') {
  		if (!msg.guild.member(msg.author).hasPermission("BAN_MEMBERS")) {
  			msg.author.sendMessage('Aleyküm selam,  hoş geldin'); 
  		} else {
  		msg.reply('Aleyküm selam, hoş geldin');
  		}
  	}
  });
  
  client.on('message', message => {
    if (message.content.toLowerCase() === prefix + "zekam") {
        var sans = ["11", "15", "20", "24", "28", "31", "39", "45", "49", "54", "58", "63", "67", "77", "73", "84", "80", "83", "96", "94", "99", "Albert Einstein mısın krdşm"];
        var sonuc = sans[Math.floor((Math.random() * sans.length))];
        const embed = new Discord.RichEmbed()
        .addField(`***___Zekan___***`, `${sonuc}`)
        return message.channel.sendEmbed(embed);
    }
    });
  
    client.on('message', message => {
      if (message.content === prefix + "kurabiye") {
          message.channel.sendMessage(`Canım gel buraya sana kurabiye vereceğim! <@${message.author.id}>`)
          message.react("🍪")
      }
  });
  
  client.on('message', msg => {
    if (msg.content.toLowerCase() === prefix + "sigara") {
    msg.channel.send(':smoking: :cloud::cloud::cloud:')
    .then(nmsg => nmsg.edit(':smoking: :cloud::cloud::cloud:'))
    .then(nmsg => nmsg.edit(':smoking: :cloud::cloud:'))
    .then(nmsg => nmsg.edit(':smoking: :cloud::cloud:'))
    .then(nmsg => nmsg.edit(':smoking: :cloud:'))
    .then(nmsg => nmsg.edit(':smoking: :cloud:'))
    .then(nmsg => nmsg.edit('**Sigaram bitti** | **Sigara İçmeyiniz.** :no_smoking: **Sigara Sağlığa Zararlıdır**'));
    }
    });
    
  client.on('message', message => {
    if (message.content.toLowerCase() === prefix + "espriyap") {
        var sans = ["Geçen gün geçmiş günlerimi aradım ama meşguldü.", "Yağmur yağmış kar peynir", "Dünya dönermiş ay da köfte…", "Bu erikson başka erik yok.", "Yıkanan Ton a ne denir Washington", "Hadi oyun oynayalım. Vazgeçtim oymadan oynayalım!", "Geçen gün kamyonu sürdüm Leonardo da Vinci.", "Doğumdan sonra çok kilo aldım. Doğduğumda 2 kiloydum şimdi 62.", "Adam 7 gün boyunca nezle olmuş. Sıkılmış bugün de Petek le olayım demiş.", "Yarasa yararlı bir hayvandır. Yararlı bir hayvan olmasaydı yaramasa derlerdi.", " Benim neden kardeşim yok baba  Seni görünce ikincisine cesaret edemedik.", "Osmanlıda kimseye borç takamıyordun mesela sikke sikke ödüyodun…", "Tatlı yiyip, tatlı konuşuluyorsa bundan sonra mantı yiyip mantıklı konuşacağız.", "Babamı sahura kaldırmayı unuttuk anneme masada ne eksik diyorum tuzluk mu diyor.", "+Okeyde kıza elin nasıl dedim. Ojeli dedi. Ben Şoka girdim. O Migrosa.", "Canım sıkkın kanka sonra gel", "Can bedenden çıkmazsa nolur? \n+Matamatik dersine geç kalır.", "Adamın biri televizyona çıkmış indirememişler.", "Bir romanı 7 kız yazarsa nolur? \n-  seven kızın romanı."];
        var sonuc = sans[Math.floor((Math.random() * sans.length))];
        return message.channel.send(sonuc);
    }
    });                                                                                                                                                                                                                                                                                                        
   
  
  ////////////////////////
  
  
  client.on("message", message => {
      if (message.content.toLowerCase() === prefix + "bilgi") {
          const embed = new Discord.RichEmbed()
              .addField("Bot Sahibi", `<@398820373103378433>`, true)
              .addField("Version", "2.0.0", true)
              .addField("Toplam Sunucu Sayısı", client.guilds.size, true)
              .addField("Toplam Kullanıcı Sayısı", client.users.size, true)
              .addField("Toplam Kanal Sayısı", client.channels.size, true)
              .addField("Kitaplık Türü", "discord.js")
              .setColor("RANDOM")
          return message.channel.sendEmbed(embed)
      }
  });
  
  var Jimp = require('jimp');
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "sniper") {
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          message.channel.send("İşleniyor.. Lütfen bekleyiniz. ⏲").then(m => m.delete(1000));
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(310, 325)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://cdn.glitch.com/b18a2fa6-68cb-49d5-9818-64c50dd0fdab%2FPNGPIX-COM-Crosshair-PNG-Transparent-Image.png?1529363625811", (err, avatar) => {
                  avatar.resize(310, 325)
                  image.composite(avatar, 2, 0).write(`./img/snip/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/snip/${client.user.id}-${user.id}.png`));
                  }, 1000);
              });
  
          });
      }
  });
  
  var Jimp = require('jimp');
  const GIFEncoder = require('gifencoder');
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "trigger") {
          const options = {
              size: 256,
            
              frames: 16
          }
  
          message.channel.send("İşleniyor.. Lütfen bekleyiniz. ⏲").then(m => m.delete(1000));
  
          function getRandomInt(min, max) {
              return Math.floor(Math.random() * (max - min + 1)) + min;
          }
          const args = message.content.split(' ').slice(1);
          let member = message.mentions.users.first()
          if (args[0] === undefined) member = message.author;
          let avatarurl = member.avatarURL;
          if (['jpg', 'jpeg', 'gif', 'png', 'webp'].some(x => args.join(' ').includes(x))) {
              avatarurl = args.join(' ').replace(/gif|webp/g, 'png');
          }
          const base = new Jimp(options.size, options.size);
          const avatar = await Jimp.read(avatarurl);
          const text = await Jimp.read('https://cdn.glitch.com/a7d3b6b8-9b7a-4aab-9ee4-1db0c07ef1eb%2Ftriggered.png?1526842782410');
          const tint = await Jimp.read('https://cdn.glitch.com/5fed2789-b430-43c5-bf1b-a8dd32d46b97%2Fred.png?1527082445373');
          avatar.resize(320, 320);
          tint.scaleToFit(base.bitmap.width, base.bitmap.height);
          tint.opacity(0.2);
          text.scaleToFit(280, 60);
          const frames = [];
          const buffers = [];
          const encoder = new GIFEncoder(options.size, options.size);
          const stream = encoder.createReadStream();
          let temp;
  (düzenlendi)
          stream.on('data', async buffer => await buffers.push(buffer));
          stream.on('end', async () => {
              return await message.channel.send({
                  files: [{
                      name: 'notechtriggered.gif',
                      attachment: Buffer.concat(buffers)
                  }]
              });
          });
          for (let i = 0; i < options.frames; i++) {
              temp = base.clone();
              if (i === 0) {
                  temp.composite(avatar, -16, -16);
              } else {
                  temp.composite(avatar, -32 + getRandomInt(-16, 16), -32 + getRandomInt(-16, 16));
              }
              temp.composite(tint, 0, 0);
              if (i === 0) temp.composite(text, -10, 200);
              else temp.composite(text, -12 + getRandomInt(-8, 8), 200 + getRandomInt(-0, 12));
              frames.push(temp.bitmap.data);
          }
          encoder.start();
          encoder.setRepeat(0);
          encoder.setDelay(20);
          for (const frame of frames) {
              encoder.addFrame(frame);
          }
          encoder.finish();
      }
  });
  
  var Jimp = require('jimp');
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "wasted") {
        message.channel.startTyping();
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(295, 295)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://cdn.glitch.com/b18a2fa6-68cb-49d5-9818-64c50dd0fdab%2F1.png?1529363616039", (err, avatar) => {
                  avatar.resize(295, 295)
                  image.composite(avatar, 4, 0).write(`./img/wasted/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/wasted/${client.user.id}-${user.id}.png`));
                  }, 1000);
            message.channel.stopTyping();
              });
          });
      }
  });
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "atatürk") {
        message.channel.startTyping();
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(295, 295)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://media.discordapp.net/attachments/490593855813713940/493472795410432011/ataturk.png?width=474&height=474", (err, avatar) => {
                  avatar.resize(295, 295)
                  image.composite(avatar, 4, 0).write(`./img/atatürk/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/atatürk/${client.user.id}-${user.id}.png`));
                  }, 1000);
            message.channel.stopTyping();
              });
          });
      }
  });
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "balance") {
        message.channel.startTyping();
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(295, 295)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://cdn.discordapp.com/attachments/490593855813713940/493472839555481621/balance5.png", (err, avatar) => {
                  avatar.resize(295, 295)
                  image.composite(avatar, 4, 0).write(`./img/hypesquad/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/hypesquad/${client.user.id}-${user.id}.png`));
                  }, 1000);
            message.channel.stopTyping();
              });
          });
      }
  });
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "bravery") {
        message.channel.startTyping();
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(295, 295)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://cdn.discordapp.com/attachments/490595761050877973/493474438981877782/bravery5.png", (err, avatar) => {
                  avatar.resize(295, 295)
                  image.composite(avatar, 4, 0).write(`./img/hypesquad/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/hypesquad/${client.user.id}-${user.id}.png`));
                  }, 1000);
            message.channel.stopTyping();
              });
          });
      }
  });
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "brilliance") {
        message.channel.startTyping();
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(295, 295)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://cdn.discordapp.com/attachments/490595761050877973/493474770344476682/brilliance5.png", (err, avatar) => {
                  avatar.resize(295, 295)
                  image.composite(avatar, 4, 0).write(`./img/hypesquad/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/hypesquad/${client.user.id}-${user.id}.png`));
                  }, 1000);
            message.channel.stopTyping();
              });
          });
      }
  });
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "nitro") {
        message.channel.startTyping();
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(295, 295)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://cdn.discordapp.com/attachments/490595761050877973/493475013865897994/nitro2.png", (err, avatar) => {
                  avatar.resize(295, 295)
                  image.composite(avatar, 4, 0).write(`./img/rank/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/rank/${client.user.id}-${user.id}.png`));
                  }, 1000);
            message.channel.stopTyping();
              });
          });
      }
  });
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "bughunter") {
        message.channel.startTyping();
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(295, 295)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://cdn.discordapp.com/attachments/490593738473734147/493747177038807041/bug_hunter2.png", (err, avatar) => {
                  avatar.resize(295, 295)
                  image.composite(avatar, 4, 0).write(`./img/rank/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/rank/${client.user.id}-${user.id}.png`));
                  }, 1000);
            message.channel.stopTyping();
              });
          });
      }
  });
  
  client.on('guildCreate', guild => {
      let channel = bot.channels.get("495924063642976258")
          const embed = new Discord.RichEmbed()
          .setColor("RANDOM")
          .setAuthor(`Giriş ${guild.name}`)
          .setThumbnail(guild.iconURL)
          .addField("Kurucu", guild.owner)
          .addField("Sunucu ID", guild.id, true)
          .addField("Toplam Kullanıcı", guild.memberCount, true)
          .addField("Toplam Kanal", guild.channels.size, true)
           channel.send(embed);
      });
  client.on('guildDelete', guild => {
      let channel = bot.channels.get("495924063642976258")
          const embed = new Discord.RichEmbed()
          .setColor("RANDOM")
          .setAuthor(`Çıkış ${guild.name}`)
          .setThumbnail(guild.iconURL)
          .addField("Kurucu", guild.owner)
          .addField("Sunucu ID", guild.id, true)
          .addField("Toplam Kullanıcı", guild.memberCount, true)
          .addField("Toplam Kanal", guild.channels.size, true)
           channel.send(embed);
      });
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "event") {
        message.channel.startTyping();
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(295, 295)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://cdn.discordapp.com/attachments/490593738473734147/493747181589626900/event3.png", (err, avatar) => {
                  avatar.resize(295, 295)
                  image.composite(avatar, 4, 0).write(`./img/rank/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/rank/${client.user.id}-${user.id}.png`));
                  }, 1000);
            message.channel.stopTyping();
              });
          });
      }
  });
  
  var oyun = [
    "🔥 tg!yardım | tg!davet 🔥",
    "👑 Yeniden | Birlikteyiz 👑",
    "🎈 Efsaneler Ölmez🎈" 
  ];
  
  setInterval(function() {
  
    var random = Math.floor(Math.random()*(oyun.length-0+1)+0);
  
    client.user.setGame(oyun[random], "https://www.twitch.tv/mrzfen");
    }, 2 * 2500);
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "partner") {
        message.channel.startTyping();
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(295, 295)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://cdn.discordapp.com/attachments/490595761050877973/493475413264171012/partner2.png", (err, avatar) => {
                  avatar.resize(295, 295)
                  image.composite(avatar, 4, 0).write(`./img/rank/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/rank/${client.user.id}-${user.id}.png`));
                  }, 1000);
            message.channel.stopTyping();
              });
          });
      }
  });
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "trinity") {
        message.channel.startTyping();
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(295, 295)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://cdn.discordapp.com/attachments/490595761050877973/493475825291886594/trinity.png", (err, avatar) => {
                  avatar.resize(295, 295)
                  image.composite(avatar, 4, 0).write(`./img/rank/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/rank/${client.user.id}-${user.id}.png`));
                  }, 1000);
            message.channel.stopTyping();
              });
          });
      }
  });
  
  client.on("message", async message => {
    var user = message.mentions.users.first() || message.author;
      if (message.content.toLowerCase() === prefix + "staff") {
        message.channel.startTyping();
          var user = message.mentions.users.first() || message.author;
          if (!message.guild) user = message.author;
  
          Jimp.read(user.avatarURL, (err, image) => {
              image.resize(295, 295)
              image.greyscale()
              image.gaussian(3)
              Jimp.read("https://cdn.discordapp.com/attachments/490595761050877973/493474770344476682/staff2.png", (err, avatar) => {
                  avatar.resize(295, 295)
                  image.composite(avatar, 4, 0).write(`./img/rank/${client.user.id}-${user.id}.png`);
                  setTimeout(function() {
                      message.channel.send(new Discord.Attachment(`./img/rank/${client.user.id}-${user.id}.png`));
                  }, 1000);
            message.channel.stopTyping();
              });
          });
      }
  });
  
  
  client.on('message', msg => {
    if (msg.content.startsWith(prefix + "çekiliş")) {
      msg.channel.send(`Çekilişi Kazanan: ${msg.guild.members.random().displayName}`);
      }
      });
  
      client.on("message", async message => {
        const args = message.content.substring(prefix.length).split(" ");
        const command = args.shift().toLowerCase();
        if (command === "tersyaz") {
            const mapping = '¡"#$%⅋,)(*+\'-˙/0ƖᄅƐㄣϛ9ㄥ86:;<=>¿@∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Z[/]^_`ɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz{|}~';
            // Start with the character '!'
            const OFFSET = '!'.charCodeAt(0);
            if (args.length < 1) {
                message.channel.send('Ters yazılacak yazıyı yazmalısın.');
            }
    
            message.channel.send(
                args.join(' ').split('')
                .map(c => c.charCodeAt(0) - OFFSET)
                .map(c => mapping[c] || ' ')
                .reverse().join('')
            )
        }
    });
    
    client.on("message", async message => {
      const args = message.content.substring(prefix.length).split(" ");
      const command = args.shift().toLowerCase();
     if (command === "mcavatar") {
                    const embed = new Discord.RichEmbed()
                        .setTitle(`**${args}** adlı kullanıcının avatarı:`)
                        .setImage(`https://cravatar.eu/avatar/${args}/100.png`)
                        .setFooter(`${message.author.tag} tarafından istendi.`, message.author.avatarURL)
                        .setColor('RANDOM');
                    message.channel.send(embed)
     }
  }); 
  
  
  client.on("message", message => {
    if (message.content.toLowerCase() === prefix + "sunucubilgi") {
        const embed = new Discord.RichEmbed()
    .setTimestamp()
    .setAuthor(message.guild.name, message.guild.iconURL)
    .addField('Sunucu Adı:', message.guild.name)
    .addField('Sunucu ID:', message.guild.id)
    .addField('Ana kanal:', message.guild.defaultChannel)
    .addField('Sunucu Bölgesi:', message.guild.region)
    .addField('Üye sayısı:', message.guild.memberCount)
    .addField('Sahibi:', message.guild.owner + ' (' + message.guild.ownerID + ')')
    .addField('Kanal sayısı:', message.guild.channels.size)
    .addField('Oluşturulma tarihi:', message.guild.createdAt)
            .setColor("RANDOM")
  
        return message.channel.sendEmbed(embed)
    }
    
    if (message.content.toLowerCase() === prefix + "botbilgi") {
        const embed = new Discord.RichEmbed()
            .addField("Bot Sahibi", `<@430011871555223553>`, true)
            .addField("Version", "0.0.1", true)
            .addField("Toplam Sunucu Sayısı", client.guilds.size, true)
            .addField("Toplam Kullanıcı Sayısı", client.users.size, true)
            .addField("Toplam Kanal Sayısı", client.channels.size, true)
            .addField("Kitaplık Türü", "discord.js")
            .setColor("RANDOM")
        return message.channel.sendEmbed(embed)
    }
  });
  
  ////////////////////////
  
  client.elevation = message => {
    if(!message.guild) {
  	return; }
    let permlvl = 0;
    if (message.member.hasPermission("BAN_MEMBERS")) permlvl = 2;
    if (message.member.hasPermission("ADMINISTRATOR")) permlvl = 3;
    if (message.author.id === ayarlar.sahip) permlvl = 4;
    return permlvl;
  };
  
  var regToken = /[\w\d]{24}\.[\w\d]{6}\.[\w\d-_]{27}/g;
  
  client.on('warn', e => {
    console.log(chalk.bgYellow(e.replace(regToken, 'that was redacted')));
  });
  
  client.on('error', e => {
    console.log(chalk.bgRed(e.replace(regToken, 'that was redacted')));
  });
  
  client.login(ayarlar.token);
  