Closed ctibo closed 2 years ago
will adjust
Done on dev. Just 1 thing I didn't have in mind regarding your statement. I wouldn't actually favor the user who reacted first. It would favor the user who has the oldest account. Because the user collection is sorted by user snowflakes, not reaction time. and the "smallest" snowflake is first. and snowflakes contain the creation timestamp of a user account.
wait what? aren't the winners random?
Done on dev. Just 1 thing I didn't have in mind regarding your statement. I wouldn't actually favor the user who reacted first. It would favor the user who has the oldest account. Because the user collection is sorted by user snowflakes, not reaction time. and the "smallest" snowflake is first. and snowflakes contain the creation timestamp of a user account.
the first roll which picks all winners is random. just when a user of that roll is invalid, the replacement of that single user is only semi-random because it kinda favors people with older accounts.
v5.2.0 released
Describe the bug
In the
roll
function, when a rolled winner is not considered a validEntry, then the first valid user in the collection is picked as a winner, without being randomized. That behavior gives more chances to the first user to react to the giveaway. Errorhttps://github.com/Androz2091/discord-giveaways/blob/08b0a4152571bb57be314df98ce34562d43a5e1f/src/Giveaway.js#L517-L528
Expected behavior
When a rolled winner is not valid, a random user should be picked instead of sequentially looping through all user entries.