302 AI Studio

Telegram

Deployment Steps

1. Create a Telegram Bot

  1. Open Telegram and chat with @BotFather (verify the username is actually @BotFather)
  2. Send the /newbot command
  3. Follow the prompts to set the bot name and username (username must end with bot)
  4. Copy and save the Bot Token (keep it secure; if leaked, revoke/regenerate via @BotFather)

2. Configure Bot Settings (Optional)

Configure via BotFather:

  • /setdescription - Set description
  • /setabouttext - Set about info
  • /setuserpic - Set avatar
  • /setjoingroups - Allow/deny adding bot to groups
  • /setprivacy - Control whether bot can see all group messages

3. Configure 302 AI Studio

Enter your Bot Token under Settings → Vibe Mode in the 302 AI Studio client, then click Update Configuration. The gateway will restart automatically, after which you can chat normally in Telegram.

Long polling mode is used by default; no public URL is required. DMs use pairing mode by default—the first contact requires approving a pairing code.

4. Send Test Message

Find your created bot in Telegram and send a message to test.

5. Pairing Authorization

By default, the bot will reply with a pairing code and pairing command.

If the bot asks you to run a pairing command (like openclaw pairing approve telegram <pairing_code>), copy the command, return to the 302 AI Studio client, and send the command to Open Claw to execute the pairing operation. Pairing codes expire after 1 hour.

After successful pairing, you can chat normally!


DM Policy

PolicyDescription
pairingPairing mode (default): Unknown senders receive a pairing code, can use after approval
allowlistAllowlist mode: Only specified user IDs can use
openOpen mode: Everyone can use
disabledDisable DM

Getting User ID

There are multiple ways to get a Telegram user ID:

Method 1 (Recommended): Via Gateway Logs

  1. Start the Gateway and DM your bot
  2. Run openclaw logs --follow and look for from.id

Method 2: Via Bot API

  1. DM your bot
  2. Use your bot token to get updates and read message.from.id:
curl "https://api.telegram.org/bot<bot_token>/getUpdates"

Method 3: Third-party Bots

  • DM @userinfobot or @getidsbot and use the returned user ID

Group Settings

If you need to use the bot in groups:

  1. Add the bot to the group
  2. If you need the bot to respond to all messages (not just @mentions), disable privacy mode in BotFather using /setprivacy, or make the bot a group admin

After toggling privacy mode, you need to remove and re-add the bot to the group for changes to take effect.

Group Message Visibility (Privacy Mode)

Telegram bots have privacy mode enabled by default, which limits which group messages they receive. If your bot must see all group messages, you have two options:

  • Disable privacy mode using /setprivacy
  • Add the bot as a group admin (admin bots can receive all messages)

Group Activation Mode

By default, the bot only responds to mentions (@botname) in groups.

Switch via Command (Session Level)

Send in the group:

  • /activation always - Respond to all messages
  • /activation mention - Require mention (default)

Commands only update session state and will revert to default behavior after restart.

Getting Group Chat ID

Forward any message from the group to @userinfobot or @getidsbot on Telegram to see the chat ID (negative number, like -1001234567890).


Feature Support

FeatureStatusDescription
DM✅ SupportedShares agent's main session
Group Chat✅ SupportedEach group maintains isolated session
Images✅ SupportedSend and receive
Files✅ SupportedSend and receive
Voice✅ SupportedVoice memos and audio files
Video✅ SupportedSend and receive
Stickers✅ SupportedStatic stickers support vision processing, animated/video stickers skipped
Inline Buttons✅ SupportedCallback buttons
Reactions✅ SupportedReceive and send reactions
Forum Topics✅ SupportedEach topic maintains isolated session

Sticker Features

Receiving Stickers

When users send stickers, OpenClaw processes them based on type:

  • Static stickers (WEBP): Downloaded and processed via vision
  • Animated stickers (TGS): Skipped (Lottie format not supported)
  • Video stickers (WEBM): Skipped (video format not supported)

OpenClaw caches sticker descriptions to avoid redundant API calls, cache location: ~/.openclaw/telegram/sticker-cache.json

Audio Messages

Telegram distinguishes between voice memos (round bubble) and audio files (metadata card). OpenClaw uses audio files by default.

To force voice memo bubble in agent replies, include the tag: [[audio_as_voice]]

Inline Buttons

Telegram supports inline keyboards with callback buttons. When users click a button, the callback data is sent back to the agent as a message in the format: callback_data: value


Native Commands

OpenClaw registers native commands to Telegram's bot menu on startup:

CommandFunction
/statusView status
/resetReset session
/modelSwitch model
/activationToggle group activation mode

Formatting

  • Outbound Telegram text uses parse_mode: "HTML"
  • Markdown-like input is rendered as Telegram-safe HTML (bold/italic/strikethrough/code/links)
  • Block-level elements are flattened to text with line breaks/bullets
  • If Telegram rejects HTML payload, OpenClaw retries with plain text

Start the Service

Complete this channel’s configuration in the 302 AI Studio client under Settings → Vibe Mode.

Limits

LimitDefaultDescription
Text Chunk4000 charsOutbound text chunked at this length
Media Size5 MBMedia download/upload limit
History50 messagesGroup history context count

Troubleshooting

Bot not responding

  • Check if the Bot Token is correct
  • Confirm the bot is started
  • Check if outbound HTTPS/DNS to api.telegram.org is blocked

No response in groups

  • Check Bot Privacy Mode settings (BotFather → /setprivacy)
  • If you need to respond to all messages, disable privacy mode or make the bot an admin
  • Confirm whether @mention is required
  • Use /activation always to test temporarily

Pairing code issues

  • Pairing codes expire after 1 hour
  • Approve pairing requests in 302 AI Studio client

Bot silently stops responding after startup

  • Some hosts resolve api.telegram.org to IPv6 first, which may hang if the server has no IPv6 egress
  • Fix by enabling IPv6 egress or forcing IPv4 resolution

setMyCommands failed error

  • Usually means outbound HTTPS/DNS to api.telegram.org is blocked
  • Check network connection and firewall settings

More Information

For more detailed configuration options, advanced features, and complete configuration reference, please refer to the official OpenClaw documentation.

On this page