text: const fs = require('fs');
  
  const Discord = require('discord.js');
  const client = new Discord.Client();
  
  const config = require('./config.json');
  client.config = config;
  
  const { GiveawaysManager } = require("discord-giveaways");
  const db = require("quick.db");
  if(!db.get("giveaways")) db.set("giveaways", []);
  
  const GiveawayManagerWithOwnDatabase = class extends GiveawaysManager {
      async getAllGiveaways(){
          return db.get("giveaways");
      }
  
      async saveGiveaway(messageID, giveawayData){
          db.push("giveaways", giveawayData);
          return true;
      }
  
      async editGiveaway(messageID, giveawayData){
          const giveaways = db.get("giveaways");
          const newGiveawaysArray = giveaways.filter((giveaway) => giveaway.messageID !== messageID);
          newGiveawaysArray.push(giveawayData);
          db.set("giveaways", newGiveawaysArray);
          return true;
      }
      async deleteGiveaway(messageID){
          const newGiveawaysArray = db.get("giveaways").filter((giveaway) => giveaway.messageID !== messageID);
          db.set("giveaways", newGiveawaysArray);
          return true;
      }
  
  };
  const manager = new GiveawayManagerWithOwnDatabase(client, {
      storage: false,
      updateCountdownEvery: 5000,
      default: {
          botsCanWin: false,
          exemptPermissions: [ "MANAGE_MESSAGES", "ADMINISTRATOR" ],
          embedColor: "#FF0000",
          reaction: "🎉"
      }
  });
  client.giveawaysManager = manager;
  
  client.giveawaysManager.on("giveawayReactionAdded", (giveaway, member, reaction) => {
      console.log(`${member.user.tag} entered giveaway #${giveaway.messageID} (${reaction.emoji.name})`);
  });
  
  client.giveawaysManager.on("giveawayReactionRemoved", (giveaway, member, reaction) => {
      console.log(`${member.user.tag} unreact to giveaway #${giveaway.messageID} (${reaction.emoji.name})`);
  });
  
  fs.readdir("./events/", (_err, files) => {
      files.forEach((file) => {
          if (!file.endsWith(".js")) return;
          const event = require(`./events/${file}`);
          let eventName = file.split(".")[0];
          console.log(`👌 Event loaded: ${eventName}`);
          client.on(eventName, event.bind(null, client));
          delete require.cache[require.resolve(`./events/${file}`)];
      });
  });
  
  client.commands = new Discord.Collection();
  
  fs.readdir("./commands/", (_err, files) => {
      files.forEach((file) => {
          if (!file.endsWith(".js")) return;
          let props = require(`./commands/${file}`);
          let commandName = file.split(".")[0];
          client.commands.set(commandName, props);
          console.log(`👌 Command loaded: ${commandName}`);
      });
  });
  
  client.login(config.token);
  