Androz2091 / discord-giveaways

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

Solution for not ending giveaways with nodemon #459

Closed Telepathique closed 2 years ago

Telepathique commented 2 years ago

Hello so i faced an issue that was caused by nodemon that keep watching for json and js by default files to restart and update the bot i found the way to keep my giveaways working after a couple hours of searching the cause. so i had to move hosting files "giveaways.json" into a folder that i named "database" then i created this file in my root of my project called nodemon.json its a native config file for nodemon

//created a nodemon.json file then 
{
  "restartable": "rs",
  "ignore": [
    ".git",
        "commands/music",
    "node_modules/**/node_modules",
        "./database/"
  ],
  "ext": "js,json"
}

after this i modified my manager to : be able to read and save from the created file :

const manager = new GiveawaysManager(bot, {
    //placed storage in database that nodemon is ignoring rn
    storage: "./database/giveaways.json",
    hasGuildMembersIntent: true,
    endedGiveawaysLifetime: 50000,
    default: {
        botsCanWin: false,
              embedColorEnd: "#90EE90",
        embedColor: "#90EE90",
        reaction: "🎉",

    },
    lastChance: {
        enabled: true,
        content: '⚠️ **LAST CHANCE TO ENTER !** ⚠️',
        threshold: 5000,
        embedColor: '#90EE90'
    }
});

Now my giveaways are fully working ( module version 5.1.1) Discord.js vestion ( 13.6.0)

Nico105 commented 2 years ago

thanks for posting it here. the thing is just that having this as an "open issue" seems odd, so idk should i just close it and treat it as general reference, or maybe convert this to a discussion?

Telepathique commented 2 years ago

thanks for posting it here. the thing is just that having this as an "open issue" seems odd, so idk should i just close it and treat it as general reference, or maybe convert this to a discussion?

general reference sound good

Nico105 commented 2 years ago

👍