Skip to content

telegram: add Telegram Bot IM integration#16

Merged
zevorn merged 2 commits intomainfrom
feat/telegram-im
Mar 15, 2026
Merged

telegram: add Telegram Bot IM integration#16
zevorn merged 2 commits intomainfrom
feat/telegram-im

Conversation

@zevorn
Copy link
Copy Markdown
Owner

@zevorn zevorn commented Mar 15, 2026

Summary

  • Add Telegram Bot support as a new IM channel (alongside Feishu)
  • HTTP long polling (getUpdates) with three-thread architecture: poll, AI worker, outbound
  • Configurable via RTCLAW_TELEGRAM_BOT_TOKEN env var or Meson -Dtelegram_bot_token=...
  • Migrate Feishu enable flag from platform Kconfig to Meson layer (business config belongs in Meson, not Kconfig)
  • api-proxy.py now supports custom port for QEMU testing of multiple services
  • Documentation updated: architecture, getting-started, usage, tuning (both en and zh)

New Files

File Description
include/claw/services/im/telegram.h Public API (init/start/set_token/get_token)
claw/services/im/telegram.c Main implementation (582 lines)

Modified Files (18)

  • Build: meson_options.txt, meson.build, claw/meson.build, claw_config.h, claw_gen_config.h.in
  • Service: claw/claw_init.c (service registration + boot test skip)
  • Kconfig cleanup: remove Feishu menu from ESP32-C3/S3 platform Kconfig
  • Proxy: scripts/api-proxy.py (custom port support)
  • Docs: architecture, getting-started, usage, tuning (en + zh), CLAUDE.md

Test Plan

  • scripts/check-patch.sh passes (0 errors, 0 warnings on new files)
  • ESP32-C3 QEMU build succeeds with -Dtelegram=true
  • QEMU boot: [telegram] init ok, started (3 threads), poll thread starting
  • getUpdates returns 200 via proxy
  • Message received: <<< recv chat=... text="hello" → queued → ai_chat called
  • Full round-trip with working AI API (blocked by API 503 during test)
  • Real hardware test (WiFi + native TLS)

zevorn added 2 commits March 15, 2026 13:25
Add Telegram Bot support as a new IM channel alongside Feishu.
Uses HTTP long polling (getUpdates) with three-thread architecture:
poll thread, AI worker thread, and outbound sendMessage thread.

Key changes:
- New: telegram.h/telegram.c (582 lines, mirrors feishu.c pattern)
- Config: telegram_bot_token + telegram_api_url via Meson/env vars
- Build: telegram boolean option in meson_options.txt + claw/meson.build
- Service: registered in claw_init.c service table
- Cleanup: migrate Feishu enable flag from platform Kconfig to Meson
- Proxy: api-proxy.py supports custom port for QEMU testing
- Docs: update architecture, getting-started, usage, tuning (en+zh)

Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
@zevorn zevorn merged commit 9dfde4a into main Mar 15, 2026
9 checks passed
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