Async Rust bot (teloxide + tokio) that: - Authenticates users per chat with a passphrase (resets daily at 5am) - Generates deterministic UUID v5 session IDs from chat_id + date - Pipes messages to `claude -p --session-id/--resume <uuid>` - Persists auth and session state to disk across restarts - Deploys as systemd --user service via `make deploy`
892 B
892 B
NOC
Telegram bot that bridges messages to claude sessions.
How it works
- User sends a message to the bot
- First message must be the auth passphrase, otherwise the bot replies "not authenticated"
- Once authenticated, messages are piped to
ms --resume <session_id>via stdin claudestdout is sent back as the reply- Sessions are scoped per chat and refresh daily at 5am local time
Setup
cp config.example.yaml config.yaml
# edit config.yaml with your values
Config
| Key | Description |
|---|---|
tg.key |
Telegram bot token |
auth.passphrase |
Passphrase required to authenticate each session |
session.refresh_hour |
Hour (local time, 24h) when sessions reset |
Deploy
make deploy
This builds the release binary and installs a systemd --user service.
Logs
journalctl --user -u noc -f