- Notifications
You must be signed in to change notification settings - Fork5.7k
Description
Is your feature request related to a problem? Please describe.
Bot-created identified poll will receivepollAnswer
updates from the Telegram server when users submit their choices (or retract their votes), which contain info about the voter (name,uid
, etc.).
Describe the solution you'd like
Create apollAnswer
class and implement related methods.
"poll_answer": {"poll_id":"0000000000000000000","user": {"id":000000000,"is_bot":false,"first_name":"first name","last_name":"last name","username":"username","language_code":"en" },"option_ids": [0 ] }
P.S.option_ids
might be[]
when a user retract his/her vote, or[0, 1]
for a multiple-choice poll
Describe alternatives you've considered
PollOption
class has avoters
property, but that only indicates the number of voters of an option. By maintaining a hash table (or something like that) in the memory and updating it every time apoll_answer
update was fetched, a bot could actually know the exact status of a poll (of course, the poll can't be an anonymous one).
This feature could be extremely useful if we need to create a weighted vote, where different voters have different weights according to the demand. (ex. deciding which movie to see tonight, and active users will have higher weights)
Additional context
None