Expose Telegram slash commands via setMyCommands#702
Open
yaroslavyaroslav wants to merge 1 commit intoRightNow-AI:mainfrom
Open
Expose Telegram slash commands via setMyCommands#702yaroslavyaroslav wants to merge 1 commit intoRightNow-AI:mainfrom
yaroslavyaroslav wants to merge 1 commit intoRightNow-AI:mainfrom
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Expose the existing Telegram bot commands through Telegram's native slash-command menu and unify command definitions across Telegram,
/help, and/api/commands.Fixes #700
Changes
setMyCommandswhen the Telegram adapter starts/help, and/api/commands/agentsand/agentin the shared command list/agentso calling it without an argument returns usage guidance plus the live list of available agents from the serverChannelBridgeHandlemethods for pending approvals and audio transcription so the current branch compiles with the existing bridge wiringTesting
cargo clippy --workspace --all-targets -- -D warningspassescargo test --workspacepassesAdditional verification:
cargo check --workspacecargo auditcargo test -p openfang-channels test_handle_command_ -- --nocapturecargo build -p openfang-api --libcargo build -p openfang-cli --bin openfangGET /api/healthGET /api/commandsreturns the unified command list, including/agentsand/agentgetMyCommandsreturns the registered Telegram command listNote:
cargo fmt --checkcurrently fails on unrelated pre-existing formatting drift elsewhere in this checkout, outside this PR diff.Security
Telegram Bot API supports native command menus, but it does not support dynamic server-driven autocomplete for command arguments after
/agent. This change uses the best available fallback by returning the live agent list when/agentis sent without an argument.