Cascade exit from nested conversations #5118
-
|
Hello. For each of the handlers, I create a separate ChatHelper object that performs various auxiliary tasks and is stored in That is, a special state
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey!
An alternative from your current appraoch, is to clear the keys from
TL;DR It can still work By default a conversation state is tracked by both
True. However the parent conversation will already be at the This also assumes updates are handled sequentially. Having concurrency enabled (see Concurrency in PTB) might cause race conditions.
Reply to previous points address this (for reference What do the per_* settings in ConversationHandler do?)
Whether updates will be processed sequentially or concurrently (Concurrency in PTB) is actually unrelated to how ConversationHandler will keep track of its active state(s) (What do the per_* settings in ConversationHandler do?). |
Beta Was this translation helpful? Give feedback.
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.An alternative from your current appraoch, is to clear the keys from
user_datarelevant to both conversations, in the nested /cancel handler.TL;DR It can still work
By default a conversation sta…