Telegram

Control your CLI-JAW agent remotely through Telegram. Send messages, receive responses, forward agent output, handle voice messages with STT, and use slash commands -- all from your phone.

Setup

1. Create a Bot with BotFather

  1. Open @BotFather in Telegram
  2. Send /newbot and follow the prompts
  3. Copy the bot token (looks like 123456:ABC-DEF...)

2. Configure settings.json

{
  "telegram": {
    "token": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
    "allowedChatIds": [],
    "forwardAll": true
  }
}
Leave allowedChatIds empty initially. Send /id to your bot to get your chat ID, then add it to the array for security.

3. Alternative: Use jaw init

jaw init --channel telegram --telegram-token "YOUR_TOKEN"

Sending and Receiving

Forwarding

When forwardAll is true, the agent's agent_done results are automatically forwarded to your Telegram chat. Telegram-origin results are excluded to avoid echo.

/forward on   # Enable forwarding
/forward off  # Disable forwarding

File Delivery

The agent can send files to Telegram using the channel send API:

POST /api/telegram/send
POST /api/channel/send  # Unified endpoint (preferred)

Files are validated against a 20MB size limit. Telegram messages are chunked at 4096 characters and converted to Telegram HTML format.

Group Chat

In group/supergroup chats, the bot only responds when mentioned with @botUsername. The mention is automatically stripped from the message before processing.

Available Commands

27 slash commands are visible in Telegram (same set as Discord). Bot-specific commands:

CommandDescription
/startWelcome message
/idShow your chat ID
/settingsBot settings (handled by bot, not the server)

Environment Variables

Settings can be overridden via environment variables:

TELEGRAM_TOKEN=123456:ABC-DEF...
TELEGRAM_ALLOWED_CHAT_IDS=12345,67890
Try it:
  • 텔레그램으로 결과 보내줘
  • 텔레그램 봇 설정해줘