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

πŸ› Force reroll/ending + resume deleted giveaways #342

Closed Nico105 closed 3 years ago

Nico105 commented 3 years ago

forcing:

/**
 * The options for a forced ending or reroll of a giveaway.
 * The manager attempts to get "giveaway.messages" and "giveaway.embedColor|giveaway.embedColorEnd" (depending on "end or reroll"), from the giveaway that was started closest to the giveaway that is forced (in the same server).
 * @typedef GiveawayForceOptions
 *
 * @property {boolean} [force=false] If the ending or reroll should be forced, when the giveaway is not found.
 * @property {Discord.TextChannel|Discord.NewsChannel|Discord.ThreadChannel} channel The channel in which the giveaway that is forced is.
 * @property {boolean} [saveGiveawayInDatabase=true] If the giveaway that is forced should be saved in the runtime giveaway array and the database.
 * @property {number} [closestGiveawayThreshold=86400000] How big the "giveaway.startAt" difference to the closest giveaway can be, before the closest giveaway is considered invalid. Default is 1 day. If there is no valid closest giveaway then "giveaway.messages" and "giveaway.embedColor|giveaway.embedColorEnd" will have default values (Set this property to "0" to always use default messages). 
 */

resuming:

manager.start(message.channel, {
    messageID: "12312312312311",
    prize: ''
    winnerCount: 1
    time: 100000
})

thoughts?

depending if #302 gets merged first, I would need to add a little code to the "auto winnerCount from footer" code.

Androz2091 commented 3 years ago

I am closing the PR but feel free to comment if you really need this feature