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

[FEATURE] Add a validation so that can every user can vote only once #125

Open
tomassirio opened this issue Oct 16, 2020 · 5 comments
Open
Labels
enhancement New feature or request Feature good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed

Comments

@tomassirio
Copy link
Owner

image

@tomassirio tomassirio added Feature enhancement New feature or request good first issue Good for newcomers hacktoberfest hacktoberfest-accepted help wanted Extra attention is needed labels Oct 16, 2020
@b2pacific
Copy link

Can I help you with this issue?

@tomassirio
Copy link
Owner Author

Sure! I'll assign it to you

@rgroves
Copy link
Collaborator

rgroves commented Oct 30, 2020

Hi @b2pacific 👋 are you still working on this issue?

@b2pacific b2pacific removed their assignment Oct 30, 2020
@RazCrimson
Copy link
Contributor

Hmm.... Should we just validate that every user has voted only once or do we need to log it to the DB?
(Also I think letting a user do multiple votes should be a choice that should be available during the poll creation)

But If we need to allow a user to vote only once, either we take a dumb approach and assign priorities to each options and the one with the higher priority is selected. The other option is the check the added reaction in real time and if a new reaction gets added then, check if the user has already vote or not, then allow their vote to remain. But this will place a lot more load on the bot..... Does anyone have an other ideas?

@rgroves
Copy link
Collaborator

rgroves commented Dec 24, 2020

@RazCrimson The ReactionCollector object, used by the poll command to keep track of the reactions to the message, has an attribute named users which could be used to check if a user already reacted to the post and if so ignore it subsequent reactions.

Alternatively—and probably a better way to go but you may need to poke around that object to see if/how this could be done—if a user reacted previously then remove the previous reaction before adding the latest one.

I think a simple Y/N flag option could be added to allow multiple votes per user and if not provided it can default to N. @tomassirio do you have an input/feedback on that? I thought adding an option was discussed before but I couldn't find the details here or in Discord.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Feature good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants