Androz2091 / discord-giveaways

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

Help: How to make command to get list of all giveaways #129

Closed ririko5834 closed 3 years ago

ririko5834 commented 3 years ago

Can someone send me example code how to get list of all active giveaways for message guild.

There should be returned giveaway channel and giveaway message link

Nico105 commented 3 years ago

62 should help you/is what you need, if you need any further help with it feel free to ask, otherwise please close this issue.

ririko5834 commented 3 years ago

Also i would like to have that old giveaways will be removed from database.

Nico105 commented 3 years ago

client.giveawaysManager.giveaways.filter(g => g.ended).forEach(g => client.giveawaysManager.deleteGiveaway(g.messageID)) Approximately like that you can also check for the g.endAt time to only delete giveaways after a specific time has passed since they ended Check on startup or on an interval

Nico105 commented 3 years ago

If you don't have a question left then please close this issue.

ririko5834 commented 3 years ago

Ok