text: const { Client, Collection } = require('discord.js');
  const { prefix } = require("./config.json");
  const db = require("quick.db")
  const client = new Client();
  
  client.config = require('./config');
  client.commands = new Collection();
  
  client.on("message", async message => {
  
    const prefixMention = new RegExp(`^<@!?${client.user.id}>( |)$`);
  
    if (message.content.match(prefixMention)) {
  
      return message.reply(`My prefix is \`${prefix}\``);
  
    }
  
    if (message.author.bot) return;
  
    if (!message.guild) return;
  
    if (!message.content.startsWith(prefix)) return;
  
    if (!message.member)
  
      message.member = await message.guild.fetchMember(message);
  
    const args = message.content
  
      .slice(prefix.length)
  
      .trim()
  
      .split(/ +/g);
  
    const cmd = args.shift().toLowerCase();
  
    if (cmd.length === 0) return;
  
    let command = client.commands.get(cmd);
  
    if (!command) command = client.commands.get(client.aliases.get(cmd));
  
    if (command) command.run(client, message, args);
  
  });
  
  require('./util/loader.js')(client);
  
  client.on("message", async message => {
  
  if(!message.guild) return;
  
    let prefix = db.get(`prefix_${message.guild.id}`)
  
    if(prefix === null) prefix = prefix;
  
    
  
    if(!message.content.startsWith(prefix)) return;
  
   
  
  })
  
  client.login(client.config.token);