← 返回首页
Cascade exit from nested conversations · python-telegram-bot/python-telegram-bot · Discussion #5118 · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus
Discussion options

{{title}}

1 You must be logged in to vote
All reactions

Hey!
An update will be handled by a maximum of only one handler per group (see application.add_handler). And since both the nested and parent conversations are added in the same group, then a one unique message update with (/cancel) will be handled by either the nested cancel handler or the parent one, not both.

Also, when the nested_registration_handler is cancelled, I want to cancel the account_handler.

An alternative from your current appraoch, is to clear the keys from user_data relevant to both conversations, in the nested /cancel handler.

In theory, such a construction won't work if there is more than one update in the queue,

TL;DR It can still work

By default a conversation sta…

Replies: 1 comment 1 reply

Comment options

{{title}}

edited

{{editor}}'s edit

{{actor}} deleted this content .

{{editor}}'s edit

Marked as answer
1 You must be logged in to vote
All reactions
1 reply
Comment options

{{title}}

❤️ 1
All reactions
Answer selected by BlizzardJedi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu

Select a reply

Loading
👍 1 reacted with thumbs up emoji 👎 1 reacted with thumbs down emoji 😄 1 reacted with laugh emoji 🎉 1 reacted with hooray emoji 😕 1 reacted with confused emoji ❤️ 1 reacted with heart emoji 🚀 1 reacted with rocket emoji 👀 1 reacted with eyes emoji

Footer

© 2026 GitHub, Inc.