Skip to main content

Telegram

KhunQuant connects to Telegram via the Telegram Bot API. The TelegramChannel adapter translates Telegram messages into the internal event bus format and back.

Capabilities

  • Typing indicator (TypingCapable)
  • Message editing (MessageEditor)
  • Emoji reactions (ReactionCapable)
  • Slash command menus (CommandRegistrarCapable)

Configuration

Add to ~/.khunquant/config.json:

{
"channels": {
"telegram": {
"enabled": true,
"token": "TELEGRAM_BOT_TOKEN",
"allow_from": ["@your_username"],
"reasoning_channel_id": "-100xxxxxxxxxx"
}
}
}

Add the bot token to ~/.khunquant/.security.yml:

channels:
telegram:
token: "1234567890:AAF..."
FieldTypeDescription
enabledboolEnable the Telegram channel
tokenSecureStringBot token from @BotFather
allow_from[]stringAllowlist of Telegram usernames or chat IDs
reasoning_channel_idstringOptional channel ID for streaming reasoning output

Setup steps

  1. Create a bot with @BotFather and copy the token.
  2. Add the token to .security.yml.
  3. Set allow_from to your Telegram username (e.g. "@yourname").
  4. Start KhunQuant — it will begin polling for messages immediately.
Group chats

To use KhunQuant in a group, add the bot as a member and configure allow_from with the group chat ID. Use group_trigger settings to control when the bot responds.