Skip to content

feat: add Telegram slash command parity and menu sync#125

Open
YooooEX wants to merge 1 commit intolsdefine:mainfrom
YooooEX:telegram-polish
Open

feat: add Telegram slash command parity and menu sync#125
YooooEX wants to merge 1 commit intolsdefine:mainfrom
YooooEX:telegram-polish

Conversation

@YooooEX
Copy link
Copy Markdown

@YooooEX YooooEX commented Apr 21, 2026

Context

Telegram currently only handles /stop and /llm, while the shared chat command surface already supports /help, /status,
/new, /restore, and /continue. This PR keeps the change radius small by limiting updates to Telegram command wiring,
shared command metadata, and README parity. No new dependencies are added.

Summary

Sync the Telegram bot command menu with the shared chat command surface and add the missing Telegram slash commands.

Changes

frontends/chatapp_common.py

  • Extract shared help command metadata into HELP_COMMANDS
  • Add TELEGRAM_MENU_COMMANDS for Telegram menu registration
  • Add build_help_text() so help text and Telegram menu definitions stay aligned

frontends/tgapp.py

  • Register Telegram bot commands on startup via ApplicationBuilder.post_init(...) and bot.set_my_commands(...)
  • Route slash commands through a dedicated Telegram command handler
  • Add Telegram support for /help, /status, /new, /restore, /continue, and /continue N
  • Normalize bot-suffixed commands such as /help@botname
  • Cancel active Telegram stream tasks before stop/reset/restore flows
  • Preserve the existing streaming, HTML rendering, and file upload behavior for normal text messages

README.md

  • Add Telegram to the list of frontends that support the common chat commands in both English and Chinese sections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant