-
Notifications
You must be signed in to change notification settings - Fork 6k
Add pass_user_data and pass_chat_data to Handler #436
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
Conversation
|
LGTM 👍. Any idea on when this'll be merged? |
|
@KamranMackey Once someone reviewed it ;) |
|
@jh0ker I reviewed it. I approved the changes 😄 |
examples/conversationbot2.py
Outdated
| bot. | ||
| """ | ||
|
|
||
| from telegram import (ReplyKeyboardMarkup) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to have parenthesis here? If not, it might be a good idea to remove it considering this is an example bot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
| custom_choice), | ||
| ], | ||
|
|
||
| TYPING_CHOICE: [MessageHandler([Filters.text], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the bitwise-filters PR this will raise a warning. Just so you're aware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this was already merged, right ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a second thought, I'll wait with that till the release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, should probably change throughout our examples at that point then :)
A solution for #385
Not exactly what was requested, but very close and more versatile. Any handler can now request the
user_dataparameter, which is adict. You can use it to store any data that is related to the user who sent the update. When the user sends another update, it will be the samedictwith the same contents, across all handlers.A
chat_datafollowing the same concept has been added as well.