Skip to content

Conversation

@JosXa
Copy link
Contributor

@JosXa JosXa commented Dec 22, 2016

When using a ConversationHandler for private and group chats in conjunction to having the bot added to a Channel, it will throw a None type exception because it cannot retrieve a chat/user id from the update.

I suggest completely ignoring all channel_posts, because the interactivity that a ConversationHandler provides is not useful in channels anyway.

Copy link
Member

@tsnoam tsnoam left a comment

Choose a reason for hiding this comment

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

Hi @Rostgnom
Thanks for your contribution, you are correct - no point in having ConversationHandler for channels.

I left a small comment on the code asking for one small change.
Also, can you be so kind and fix the class documentation and add a note that this handler doesn't support chats?

return False

# Ignore messages in channels
if update.channel_post:
Copy link
Member

Choose a reason for hiding this comment

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

Can you please "join" this with the if above?

@tsnoam tsnoam self-assigned this Dec 23, 2016
@tsnoam tsnoam added the 📋 pending-reply work status: pending-reply label Dec 23, 2016
@JosXa
Copy link
Contributor Author

JosXa commented Dec 24, 2016

Changed the file as requested. I also added a notion that the ConversationHandler currently does not work in a group chat with multiple users, in that the states do only switch for the user performing the transition/action. Is that clear from what I added to the class doc?
The latter actually looks like a bug to me. For example, when the bot sends a nested/multi-layer keyboard menu to a group chat and has a ConversationHandler managing this conversation, shouldn't the whole group be able to interact with the menu collectively? Currently, the handler is blocking inputs for all others once a single user has pressed a KeyboardButton and thereby switched the conversations state only for himself.

@tsnoam tsnoam merged commit 6a01164 into python-telegram-bot:master Dec 25, 2016
@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

📋 pending-reply work status: pending-reply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants