Telegram
KhunQuant connects to Telegram via the Telegram Bot API. The TelegramChannel adapter translates incoming Telegram messages into the internal event bus format and routes responses back. Telegram is the recommended starting channel due to its straightforward setup and first-class voice transcription support.
Capabilities
- Typing indicator (
TypingCapable) - Message editing (
MessageEditor) - Emoji reactions (
ReactionCapable) - Slash command menus (
CommandRegistrarCapable) - Voice message transcription (via Whisper)
- Photo, audio, and document handling
Configuration
Add to ~/.khunquant/config.json:
{
"channels": {
"telegram": {
"enabled": true,
"token": "TELEGRAM_BOT_TOKEN",
"allow_from": ["@your_username"],
"reasoning_channel_id": "-100xxxxxxxxxx",
"base_url": "",
"proxy": ""
}
}
}
Store the bot token in ~/.khunquant/.security.yml:
channels:
telegram:
token: "1234567890:AAF..."
| Field | Type | Description |
|---|---|---|
enabled | bool | Enable the Telegram channel |
token | SecureString | Bot token from @BotFather |
allow_from | []string | Allowlist of Telegram usernames or chat IDs |
reasoning_channel_id | string | Optional channel ID for streaming reasoning output |
base_url | string | Custom Telegram API server endpoint (optional) |
proxy | string | Network proxy in socks5:// or http:// format (optional) |
Setup steps
- Open Telegram and start a chat with @BotFather.
- Send
/newbotand follow the prompts to create a bot — copy the authentication token. - Contact @userinfobot to retrieve your numeric user ID.
- Add the token to
.security.ymland your user ID toallow_from. - Start KhunQuant — it will begin polling for messages immediately.
Built-in bot commands
Once the bot is running, the following commands are available inside Telegram:
| Command | Description |
|---|---|
/start | Display the welcome message |
/help | Show available commands and usage |
/show | Print the current active configuration |
/list | List all available configuration options |
Voice transcription
To enable automatic transcription of voice messages, configure a Whisper-compatible model in your provider settings:
{
"asr": {
"model": "groq/whisper-large-v3",
"api_key": "YOUR_GROQ_API_KEY"
}
}
Obtain a free API key from console.groq.com.
Add the bot to a group, then set allow_from to the group chat ID. Use group_trigger settings to control whether the bot responds to every message or only when explicitly mentioned.
If Telegram is blocked in your region, set the proxy field to a socks5:// or http:// proxy address.