Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharding and Quickmongo does not work together #445

Open
Tomato6966 opened this issue Mar 19, 2022 · 3 comments
Open

Sharding and Quickmongo does not work together #445

Tomato6966 opened this issue Mar 19, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Tomato6966
Copy link

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...
@Tomato6966 Tomato6966 added the bug Something isn't working label Mar 19, 2022
@Tomato6966
Copy link
Author

If I'm getting the db data with fetching directly from the mongodb (true)
i receive this

but as you see it should have ended already
image

@Nico105
Copy link
Collaborator

Nico105 commented Mar 19, 2022

refreshStorage isn't actually needed "anymore", you can remove it.

@Tomato6966
Copy link
Author

But it still doesnt "end"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants