-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[FEATURE] Interruption behaviour of Conversations #1640
Comments
Please habe a look at the group argument of do.add_handler. TLDR: only one handler per group is excecuted. Putting your |
@Bibo-Joshi Sorry, I read documentation and source code for |
Well, it doesn't prevent a conversation from being interrupted but can be used to solve this:
See the discussion in #1447 |
I added groups to handlers and it's solved my problem (interrupt conversation after some command), but such a method seems a bit hacky to achieve my goal.
I do not have idea hot improve that, maybe some flag to the conversational handler that interrupts the conversation when update handled by some handler outside of conversation and some parameters |
Well your solution
Would you like to give at a go yourself? |
PS: Preventing your CH from interruption can be done by adding fallback in the "isolated" CH that catches e.g. entrypoints of other conversations. However, this will only work for handlers in the same group. Also, if you'd like to PR, please tell us about your proposed changes beforehand, so we can keep in touch b/c CH is quite complex … |
Sorry, I don't have time to work on this feature |
A very dirty hack that ends all conversational handlers. Modify under your task.
2021-07-01, Comment by @Bibo-Joshi : The |
Leaving this here for completeness sake: Nested CHs need to be considered, if this is tackled. |
Looking back at this, I'm not sure adding this as a feature is a good idea for mainly two reasons: a) It would mean tightly coupling the Finally there are viable workarounds like storing flags like |
After internal discussion, we don't see this feature being implemented, at least not in the forseable future. If someone finds this comment and really wants this feature: Feel free to comment or open a new issue that references this one. |
Issue I am facing
Hi, I have faced a problem where I have a few conversations and a few commands:
Now when my bot handles conversation for
command3
, I can easy to interrupt the conversation by entering command2 or command3. But interruption doesn't reset state of conversation for command3.For example:
The last sentence is not obvious, why I need a video (do_something3_fallback) when I finished the conversation in the middle of full conversational? More generaly I expect to see the result of
global_fallback
.My idea to add a parameter
isolated
to conversational that doesn't allow interruption by any command and when such conversational started than dispatcher can only view handlers of started conversation.I know that I can implement it by nesting Conversational Handlers, but then my code looks very ugly and messy.
The text was updated successfully, but these errors were encountered: