quick.db
  1. onst db = require('quick.db');
  2.  
  3. module.exports = {
  4.     config: {
  5.         name: "setprefix",
  6.         aliases: ['sp', 'prefix'],
  7.         category: "moderation",
  8.         description: "Sets Custom Prefix",
  9.         usage: "[prefix]",
  10.         accessableby: 'Administrators'
  11.     },
  12.     run: async (bot, message, args) => {
  13.         if (!message.member.hasPermission('ADMINISTRATOR')) return message.channel.send("**You Do Not Have Sufficient Permissions! - [ADMINISTRATOR]**")
  14.  
  15.         if (!args[0]) {
  16.           let b = await db.fetch(`prefix_${message.guild.id}`);
  17.           if (b) {
  18.         return message.channel.send(
  19.           `**Prefix Of this Server is `${b}`**`
  20.         );
  21.       } else return message.channel.send("**Please Enter A Prefix To Set!**");
  22.     }
  23.      
  24.         try {
  25.  
  26.             let a = args.join(' ');
  27.             let b = await db.fetch(`prefix_${message.guild.id}`)
  28.  
  29.             if (a === b) {
  30.                 return message.channel.send('**This is Already The Server Prefix!**')
  31.             } else {
  32.                 db.set(`prefix_${message.guild.id}`, a)
  33.  
  34.                 return message.channel.send(`**Successfuly Set Server Prefix To `${a}`**`)
  35.             }
  36.         } catch (e) {
  37.             console.log(e)
  38.         }
  39.     }
  40. }
Parsed in 0.013 seconds