Callback Actions
The inline keyboard demo uses callback queries to show button-driven bot behavior.
Callback data format
The current buttons use the menu: prefix.
Supported actions:
menu:hellomenu:sessionmenu:help
Using a prefix-based scheme is important because it keeps routing simple and avoids accidental overlap when more callback-driven features are added.
Runtime behavior
When a callback query arrives:
- The handler strips the
menu:prefix - It resolves the action
- It records
last_commandasmenu:<action> - It answers the callback query with a short
Doneacknowledgement - It sends a regular chat message with the full response
Session-aware action
menu:session demonstrates that callback flows can update the same session state used by slash commands. It increments session_hits and includes the active backend in the reply text.
Unknown actions
Unrecognized callback suffixes produce Unknown menu action.
This gives you a clear failure mode while you are extending the keyboard surface.