Androz2091 / discord-giveaways

🎉 Complete framework to facilitate the creation of giveaways using discord.js
https://discord-giveaways.js.org
MIT License
336 stars 127 forks source link

Client is require option #489

Closed whoisbueno closed 1 year ago

whoisbueno commented 1 year ago

I was setting the giveawaysManager in the client and the following error appeared: Client is require option, it's probably my mistake and I don't think it's a bug, anyone who can help me will be grateful... I was setting it like this:

const { GiveawaysManager } = require("discord-giveaways");

class Main extends Client {
    constructor(options) {
        super(options);
        this.commands = new Collection();
        this.aliases = new Collection();
        this.database = new Collection();
        this.subcommands = new Collection();
         this.cooldowns = new Collection();
   this.giveawayManager = new GiveawaysManager(this.client, {
    storage: "./src/database/extensions/giveaway.json",
    updateCountdownEvery: 3000,
    default: {
        botsCanWin: false,
        embedColor: "#ff58c3",
        reaction: "🌸"
    }
  })
    }// the rest is not necessary to show 
whoisbueno commented 1 year ago

I already solved the error, I was passing this.client instead of just this.