Androz2091 / discord-giveaways

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

Requirements For Participating in Giveaways #38

Closed AdibHoque closed 4 years ago

AdibHoque commented 4 years ago

Hello there! I would like to request you for requirement feature in your discord-giveaways module. Requirement feature means the person who emits to join the give-away must complete condition of joining a server, have a certain role or have minimum amount of messages. If he doesn't meet the requirement and tries to join the give-away, bot will remove his reaction and send him a dm to complete the requirement first. I know it is hard but I guess nothing will be hard for you.

twlite commented 4 years ago

I guess we can do it ourselves but implementation of that in the package would be great 😁😀

Androz2091 commented 4 years ago

Actually that's not possible, we need to create a reactionAdded event, which is triggered when someone joins a giveaway.

AdibHoque commented 4 years ago

Yea reactionAdded event is obvious for that. If it's not possible within the module can you give us other examples or possible ways how to do it?

Androz2091 commented 4 years ago

Actually, that's simply... impossible until I make the package update. Or you'll have to handle the reactions yourself, but it's very complicated and I don't recommend that you do that.

twlite commented 4 years ago

@AdibHoque you can store the giveaway message id in your database with the requirement and hit the database in every reaction, filter the message and then if message is the giveaway message, check for the requirement and if the user isn't eligible for the giveaway, you have to remove their reaction from the msg.

Androz2091 commented 4 years ago

Yes, it was the "not recommended" way. :smile: You will need to check things like if the giveaway is ended.

twlite commented 4 years ago

Yeah that's important 😅

Androz2091 commented 4 years ago

Implemented in 4.0.0. You can now listen for the giveawayReactionAdded and make your own checks!