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

Anonymous Poll with Live Count - Send PMs #84

Open
boonebytes opened this issue Dec 24, 2021 · 0 comments · May be fixed by #88
Open

Anonymous Poll with Live Count - Send PMs #84

boonebytes opened this issue Dec 24, 2021 · 0 comments · May be fixed by #88

Comments

@boonebytes
Copy link

Would like to suggest a feature, with proposed code changes.

When running an anonymous poll with the live counts, our members do not receive a confirmation that their vote was added. When there are multiple people voting, this could cause some confusion as to if a vote is counted or not. Sure, users could use the reaction to get a PM of their current vote, but not many of our users are aware of this.

I'd like to suggest sending a PM when the vote is received, if the poll is anonymous OR live counting is disabled... as opposed to the current AND condition.

I'd also like to suggest sending a PM when someone unvotes.

Here's a snapshot of the related lines of code that could be changed to accomplish this:

diff --git a/models/poll.py b/models/poll.py
index 7cb01a2..15561ac 100644
--- a/models/poll.py
+++ b/models/poll.py
@@ -1487,6 +1487,7 @@ class Poll:
             if vote:
                 await vote.delete_from_db()
                 await self.refresh(message)
+                await self.bot.loop.create_task(user.send(f'Your vote for **{self.options_reaction[choice]}** has been REMOVED.'))
                 return
 
         # check if already voted for the same choice
@@ -1524,7 +1525,7 @@ class Poll:
             if not answer or answer.lower() == "-":
                 answer = "No Answer"
 
-        if self.anonymous and self.hide_count:
+        if self.anonymous or self.hide_count:
             self.bot.loop.create_task(user.send(f'Your vote for **{self.options_reaction[choice]}** has been counted.'))
 
         # commit

I'm not a Python programmer... but hopefully this demonstrates my suggestion well.

Thanks for all your help with the Pollmaster! Much appreciated!

@boonebytes boonebytes changed the title Anonymous Pool with Live Count - Send PMs Anonymous Poll with Live Count - Send PMs Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant