Facebook
From message, 2 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 209
  1. const ayarlar = require('./ayarlar.json'); // Ayarlar dosyasını doğru şekilde alma
  2.  
  3. module.exports = (client, message) => {
  4.     // `client.elevation` fonksiyonu tanımlanıyor
  5.     const elevation = message => {
  6.         let permlvl = 0;
  7.         if (message.author.id === ayarlar.sahib) permlvl = 0;
  8.         return permlvl;
  9.     };
  10.  
  11.     if (!message.content.startsWith(ayarlar.prefix) || message.author.bot) return;
  12.  
  13.     const args = message.content.slice(ayarlar.prefix.length).trim().split(/ +/);
  14.     const command = args.shift().toLowerCase();
  15.  
  16.     let perms = elevation(message); // `client.elevation` fonksiyonu çağrılıyor
  17.  
  18.     let cmd;
  19.     if (client.commands.has(command)) {
  20.         cmd = client.commands.get(command);
  21.     } else if (client.aliases.has(command)) {
  22.         cmd = client.commands.get(client.aliases.get(command));
  23.     }
  24.  
  25.     if (cmd) {
  26.         if (perms < 0) return; // Yetki kontrolü
  27.         cmd.run(client, message, args, perms); // `params` yerine `args` kullanıldı
  28.     }
  29. };
  30.