Facebook
From Çağan, 4 Years ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 391
  1. const Discord = require('discord.js');
  2. const db = require('quick.db')
  3.  
  4. exports.run = async (client, message, args) => {
  5.  
  6.   if (!message.member.hasPermission('ADMINISTRATOR')) return message.reply('Bu komudu kullanmak için yeterli yetkiniz yok.')
  7.   const arg = args[0]
  8.   if (!arg) return message.reply('Limit belirlemek için bir sayı girmelisin, ya da özelliği kapatmak için `!ban-limit kapat` yazmalısın.')
  9.  
  10.   if (arg == 'kapa' || arg == 'kapat') {
  11.     if (!db.has(`banlimit_${message.guild.id}`)) return message.reply('Bu özellik zaten kapalı.')
  12.     db.delete(`banlimit_${message.guild.id}`)
  13.     message.reply('Özellik başarıyla kapatıldı.')
  14.   }else{
  15.     if (isNaN(Number(arg))) return message.reply('Limiti belirlemek için bir **sayı** girmelisin.')
  16.     db.set(`banlimit_${message.guild.id}`, Number(arg))
  17.     message.reply(`Ban limiti başarıyla \`${arg.toString()}\` olarak belirlendi. Artık sunucudaki yetkililer maksimum ${arg} kere ban atabileceklerdir.`)
  18.   }
  19.  
  20. };
  21.  
  22. exports.conf = {
  23.   enabled: true,
  24.   guildOnly: true,
  25.   aliases: ['banlimit'],
  26.   permLevel: 0
  27. };
  28.  
  29. exports.help = {
  30.   name: 'ban-limit',
  31.   description: 'Ban limiti ayarlar',
  32.   usage: 'banlimit'
  33. };