feat(telegram): add chat session mode (#102)

This commit is contained in:
banteg
2026-01-12 19:05:39 +04:00
committed by GitHub
parent 7825dd73a9
commit 637a9fc3e2
18 changed files with 622 additions and 30 deletions
+19
View File
@@ -40,6 +40,25 @@ example, `http://localhost:8000/v1`) and a dummy `OPENAI_API_KEY` if your server
ignores it. If your server requires a specific model name, set
`voice_transcription_model` (for example, `whisper-1`).
## Chat sessions (optional)
Takopi is stateless by default unless you reply to a bot message containing a resume
line. If you want auto-resume without replies, enable chat sessions.
Configuration (under `[transports.telegram]`):
```toml
session_mode = "chat" # or "stateless"
```
Behavior:
- Stores one resume token per chat (per sender in group chats).
- Auto-resumes when no explicit resume token is present.
- Reset with `/new`.
State is stored in `telegram_chat_sessions_state.json` alongside the config file.
## Message overflow
By default, takopi trims long final responses to ~3500 characters to stay under