Skip to content

pollbot.py example was sending the poll to the effective_user and not… - #2047

Merged
Bibo-Joshi merged 2 commits into
python-telegram-bot:masterfrom
lrezende:pollbot-chatid-to-effective-chat
Aug 13, 2020
Merged

pollbot.py example was sending the poll to the effective_user and not…#2047
Bibo-Joshi merged 2 commits into
python-telegram-bot:masterfrom
lrezende:pollbot-chatid-to-effective-chat

Conversation

@lrezende

Copy link
Copy Markdown
Contributor

It's about pollbot.py example. The poll command was sending the poll to the update.effective_user.id... I think it should be update.effective_chat.id so multiple chat members could answer the poll.

… effective_chat... well, it's a poll to be answered by multiple uses.
@Poolitzer

Copy link
Copy Markdown
Member

Well the answers are only received on a user basis, not chat one, so the "answer" will be send in a private chat anyway. I dont really see a big gain of your PR but I dont mind it either

@lrezende

Copy link
Copy Markdown
Contributor Author

I think the pollbot example was meant to have some answers in the same poll_id...

# Close poll after three participants voted
if context.bot_data[poll_id]["answers"] == 3:

If you send the poll to a private chat(user) it will never receive more than one answer.
Correct me if I'm wrong. I'm just starting with ptb and open source contribution.

@Poolitzer

Copy link
Copy Markdown
Member

No yeah I guess you are right, never thought about running it in a group, but that change is OK.

@Poolitzer Poolitzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Bibo-Joshi

Copy link
Copy Markdown
Member

pytest fails obviously unrelated and we can ignore the examples warning, as there is nothing new in the example. Merging.
Thanks for the contribution @lrezende !

@Bibo-Joshi
Bibo-Joshi merged commit dea24bc into python-telegram-bot:master Aug 13, 2020
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants