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:
MoltBot Service
2026-02-13 20:55:04 +00:00
parent d1bb67abc1
commit 2d8e56d44c
6 changed files with 849 additions and 6 deletions

View File

@@ -1,11 +1,17 @@
{
"bot": {
"name": "Echo",
"default_model": "sonnet",
"owner": null,
"default_model": "opus",
"owner": "949388626146517022",
"admins": []
},
"channels": {},
"channels": {
"echo-core": {
"id": "1471916752119009432",
"default_model": "opus"
}
},
"telegram_channels": {},
"heartbeat": {
"enabled": true,
"interval_minutes": 30
@@ -20,4 +26,4 @@
"logs": "logs/",
"sessions": "sessions/"
}
}
}