Skip to content

Conversation

@jh0ker
Copy link
Member

@jh0ker jh0ker commented Oct 10, 2016

A solution for #385

Not exactly what was requested, but very close and more versatile. Any handler can now request the user_data parameter, which is a dict. 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 same dict with the same contents, across all handlers.

A chat_data following the same concept has been added as well.

@jh0ker jh0ker added enhancement 📋 pending-review work status: pending-review labels Oct 19, 2016
@jh0ker jh0ker changed the title Add pass_user_data to Handler Add pass_user_data and pass_chat_data to Handler Oct 20, 2016
@evieluvsrainbows
Copy link

LGTM 👍. Any idea on when this'll be merged?

@jh0ker
Copy link
Member Author

jh0ker commented Oct 25, 2016

@KamranMackey Once someone reviewed it ;)

@evieluvsrainbows
Copy link

@jh0ker I reviewed it. I approved the changes 😄

bot.
"""

from telegram import (ReplyKeyboardMarkup)
Copy link
Member

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.

Copy link
Member Author

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],
Copy link
Member

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.

Copy link
Member Author

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 ^^

Copy link
Member Author

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

Copy link
Member

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 :)

@jh0ker jh0ker merged commit 10bdf82 into master Oct 25, 2016
@jsmnbom jsmnbom deleted the user-storage branch May 20, 2017 13:51
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2020
@Bibo-Joshi Bibo-Joshi added 🔌 enhancement pr description: enhancement and removed enhancement labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🔌 enhancement pr description: enhancement 📋 pending-review work status: pending-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants