-
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] class-based nested conversations #2827
Comments
Hi. Thanks for elaborating. Since improvements ideas for CH keep coming in and we're currently concentrating on the asyncio switch, I'll add this to #2770 for now so that we can come back to it later :) That said, could you try and explain more detaild what you mean by predefined states and how class-based CHs could/would improve handling of nested conversations? I didin't really get those points. |
Oops, seems like I missed this message @Bibo-Joshi. Sure, let me elaborate: how class-based CHs could/would improve handling of nested conversations? Predefined states:
|
Thanks for getting elaborating. However, I'm still having troubles to understand how classes would help with the things that you mention.
how would wrapping nested conversations into class-based conversationhandlers change that?
Can you explain what kind of extra functions you are thinking of and what you would expect them to do?
Not necessarily. States just need to be unique per conversation (because that's just how
IMO that's more a question of design/taste, i.e. how you personally would like your states to be named
you can already name your states |
closing due to inactivity |
What kind of feature are you missing? Where do you notice a shortcoming of PTB?
I opened a similar issue some time ago, but it got closed because of my inactivity. I'm gonna try to open it up for discussion again, this time hoping to provide more details :)
In the current function-based way of making bots (which is the default way in the examples provided), it can get very complex and messy to make nested conversations.
Imagine a menu with a nested conversation for each button, and sometimes another nested conversation inside one of those. It gets quite confusing to find where each function is, and its hard to organize things in different files without running to circular import issues.
Describe the solution you'd like
I believe having a class called Conversation could help. It would basically be some kind of wrapper for all the functions of the conversation, plus its ConversationHandler.
Possible features and benefits:
I think this could potentially be time-consuming (depending on how big one would go for it) and might need some things to change in the library, because it's kinda different from how ptb is currently set up. But if implemented, it could help a lot for making nested conversations.
Describe alternatives you've considered
No response
Additional context
Maybe people are already using ptb conversations within classes, I dont know. but if that's the way everyone does it, then the examples should reflect that. In any case, I think ptb could benefit from being more class-friendly in nested conversations :)
The text was updated successfully, but these errors were encountered: