Closed
Conversation
Contributor
|
I just drafted |
Contributor
|
How about |
Member
Author
Do you mean just the naming of the parameter or would you suggest allowing arbitrary entry points? |
Member
Author
|
Closing for now. I don't think this approach will ever make it into the main lib. We might see better approaches in a contrib repo. Refer to #1912 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

While working on my personal bot, I found building menus with
InlineKeyboardMarkupsto be somewhat tiresome sometimes. You have to build a lot ofInlineKeyboardButtons, add a lot ofCallbackQueryHandlersto yourConversationHandlerand keep the overview in the process.This is an attempt to build a more user friendly handler as "wrapper" on top of the
ConversationHandlerfor creating menus. For each state only the following information is needed:(button_label, next_state)-type tuplesAll the labels/text may also be replaced by a callback to adjust the texts according to the user input, but that is optional.
A
InlineMenuHandlercould look like this:Especially for menus that need little processing of the user input, I hope that this is easier to maintain than a full grown
ConversationHandler.I'm aware that such a new feature will needs thorough discussion, may well be rejected and also that we have other issues to discuss in dev chat :D Still, I wanted to put it out here.