- Notifications
You must be signed in to change notification settings - Fork5.7k
Description
I want to have encapsulated (one file for each) nested conversation handlers, but there's no way to trigger callbacks in a parent conversation (despite being able to trigger a parent state withmap_to_parent
. The nested conversation example only works because the different conversations are not encapsulated from each other, so a nested conversation can just directly call a callback the parent conversation uses.
I think it would be great to have transitional states. For an example menu, right now a conversation handler sets up the keyboard in the entry point, then goes to aMENU
state to handle the updates, and a child conversation needs to call the parent's setup method and then transition to the parentMENU
(viamap_to_parent
). I want the parent's entry to not reply and instead go to a transitionSETUP_MENU
, which as soon as it's entered sends the menu and transitions toMENU
. This way, if I want to go back to the parent menu, I can simply transition from the child conversation to the parentSETUP_MENU
and preserve encapsulation.
I considered that this could possibly be achieved with a state that somehow triggers an update for itself, but I don't know self-trigger like that. Either a special handler or tips for self-triggering would be greatly appreciated, and either way it could simplify the nested conversation example quite substantially imo