stage-12: Telegram bot adapter
- New src/adapters/telegram_bot.py: full Telegram adapter with python-telegram-bot v22 - Commands: /start, /help, /clear, /status, /model, /register - Inline keyboards for model selection - Message routing through existing router.py - Private chat: admin-only access - Group chat: responds to @mentions and replies to bot - Security logging for unauthorized access attempts - Message splitting for 4096 char limit - Updated main.py: runs Discord + Telegram bots concurrently - Telegram is optional (gracefully skipped if no telegram_token) - Updated requirements.txt: added python-telegram-bot>=21.0 - Updated config.json: added telegram_channels section - Updated cli.py doctor: telegram token check (optional) - 37 new tests (410 total, zero failures) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
9
cli.py
9
cli.py
@@ -174,7 +174,14 @@ def cmd_doctor(args):
|
||||
except Exception:
|
||||
checks.append(("Ollama reachable", False))
|
||||
|
||||
# 10. Discord connection (bot PID running)
|
||||
# 10. Telegram token (optional)
|
||||
tg_token = get_secret("telegram_token")
|
||||
if tg_token:
|
||||
checks.append(("Telegram token in keyring", True))
|
||||
else:
|
||||
checks.append(("Telegram token (optional)", True)) # not required
|
||||
|
||||
# 11. Discord connection (bot PID running)
|
||||
pid_ok = False
|
||||
if PID_FILE.exists():
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user