Skip to content

Sharding and Quickmongo does not work together #445

@Tomato6966

Description

@Tomato6966

My code is:

const { GiveawaysManager } = require('discord-giveaways');
const CustomGiveawayManager = class extends GiveawaysManager {
    async getAllGiveaways() {
        console.log("getAllGiveaways".bgGreen)
        return await client.giveawayDB.all(true);
    }
    async saveGiveaway(messageId, giveawayData) {
        await client.giveawayDB.set(messageId, giveawayData);
        return true;
    }
    async editGiveaway(messageId, giveawayData) {
        await client.giveawayDB.set(messageId, giveawayData);
        return true;
    }
    async deleteGiveaway(messageId) {
        await client.giveawayDB.delete(messageId);
        return true;
    }
    async refreshStorage() {
        console.log("refreshStorage".bgGreen)
        return client.cluster.broadcastEval(`this.giveawaysManager.getAllGiveaways()`);
    }
};
const manager = new CustomGiveawayManager(client, {
    default: {
        botsCanWin: false,
        embedColor: ee.color,
        embedColorEnd: ee.wrongcolor,
        reaction: '🎉'
    }
});
client.giveawaysManager = manager;

If i restart the bot after starting a giveaway getAllGiveaways is logged but never refreshStorage

  • After the restart, it's not ending the giveaway, however, if the bot stays online after starting the giveaway it will end it...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions