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

Drop ends with 0 winners if participant triggers exemptMembers #429

Closed
GeistFighter opened this issue Jan 30, 2022 · 9 comments
Closed

Drop ends with 0 winners if participant triggers exemptMembers #429

GeistFighter opened this issue Jan 30, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@GeistFighter
Copy link

GeistFighter commented Jan 30, 2022

Describe the bug

In fact, the problem is that when a person who is normally part of the exclusions reacts, he is counted in the drop as a person who reacts, but is not counted in the fact that he can win, so if there is only one winner on the drop, if the 1st to add the reaction is a person who is part of the exclusions, the drop stops because it takes him into account, but indicates the "NoWinner" because he is excluded, so it would be necessary that the exclusions are also applied to the counter of the Drop reaction.

On the other hand, if there are several winners in the drop, if among the winners there are people excluded, the number of winners will not be equal to the number of winners set.

Error

The error is that it sets the "noWinner" variable directly, so the Giveaway stops, the error is the "noWinner", i don't have a real error, I don't know if that is clear?

To Reproduce

Steps to reproduce the behavior:
Example 1:

  • Launching a Giveaway Drop with 1 winner
  • The 1st person to set the reaction must be a user excluded from the rewards
  • Giveaway ends without a winner

Example 2:

  • Start a Giveaway Drop with 2 winners
  • The 1st person who sets the reaction must be a non-excluded user and then the second must be excluded from rewards
  • The Giveaway ends with one winner instead of two

Expected behavior
That users excluded from the rewards do not count against the Giveaways Drop counter.

Screenshots
I can make a video if necessary.

Additional context

  • discord-giveaways version: 5.1.0
  • discord.js version: 13.6.0

Thanks you !

@GeistFighter
Copy link
Author

@imranbarbhuiya
Copy link
Contributor

#213 this can solve your issue

@GeistFighter
Copy link
Author

Hi, yes indeed, putting an option that checks the number of winners required would solve the problem, but it would be like adding more steps, in this case, it would be easier to add the check of exemptMembers directly to the addition of the reaction on the Giveaway Drop ?

@Nico105
Copy link
Collaborator

Nico105 commented Feb 1, 2022

Hi, yes indeed, putting an option that checks the number of winners required would solve the problem, but it would be like adding more steps, in this case, it would be easier to add the check of exemptMembers directly to the addition of the reaction on the Giveaway Drop ?

exemptMembers was meant as a barrier directly before ending, e.g. when the bot was offline and users reacted.

What you mean is technically the reactionAdded event.
But it won't really be "fast" enough (isn't awaited) if there is only 1 winner/when 2/3 reacted and the 3rd one reacts

@Nico105
Copy link
Collaborator

Nico105 commented Feb 1, 2022

This will get solved when I somewhen have the time to do #107 in the form of a endRequirement (name not final I guess) function.
I started working on it some time ago but delayed it for now.
#213 is limited in it's use case. So ^^^ would give more options.

@Nico105 Nico105 changed the title Giveaways Drop crash Drop ends with 0 winners if participant triggers exemptMembers Feb 1, 2022
@Nico105 Nico105 added enhancement New feature or request and removed bug Something isn't working labels Feb 1, 2022
@imranbarbhuiya
Copy link
Contributor

I believe this can be fixed by adding giveaway.checkUserEntry in this filter

filter: (r, u) =>

@Nico105
Copy link
Collaborator

Nico105 commented Mar 25, 2022

what should be done about the case, that a drop "never" reaches it's winnerCount.
cause that could potentially lead to dead drops littering the system.
should there be a data deletion after e.g. 1 week, when a drop hasn't ended yet?

@imranbarbhuiya
Copy link
Contributor

should there be a data deletion after e.g. 1 week, when a drop hasn't ended yet?

Yeah it'll be cool

@Nico105
Copy link
Collaborator

Nico105 commented Jun 5, 2022

v5.2.0 was released.
(Should fix the issue, if I didn't forget smth XD)

@Nico105 Nico105 closed this as completed Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants