Skip to content

Telegram

Connect your Telegram account, and your agent can react to messages in the chats you pick. It signs in as your Telegram user, not a bot, so it can see your private chats, groups, and channels.

  • The agent must run on the OpenClaw runtime.
  • You need the phone number for your Telegram account.
  • On a self-hosted agent, the host needs Python 3.9 or later. Managed agents already have Python.
  • Only subscribe to chats you have permission to process, and follow Telegram’s API terms.

Telegram is a connection on one agent, not a channel, so it’s under Connections.

  1. Open the agent in the dashboard and select its Connections tab.

  2. Select Add new connection, then Telegram (local user session). Alfe prepares Telegram on the agent, which takes a moment.

  3. Enter your Mobile number, including the country code.

  4. Enter the Verification code Telegram sends you.

  5. If you use two-step verification, enter your password.

  6. When you see Telegram connected, select Done.

A sign-in attempt expires after 10 minutes. If that happens, select Start again.

The connection shows Enabled on agent, which means Telegram is turned on. The sign-in itself lives on the agent, so ask the agent for its Telegram status to check it. To sign in again later, select Sign in on the connection.

The agent reads nothing until you subscribe it to a chat. Ask the agent to:

  1. List the chats your account can see.
  2. Subscribe to the ones you pick.
  3. Unsubscribe later if you change your mind.

New text messages and captions in subscribed chats can then start work for the agent.

  • Your session stays on the agent’s machine. Alfe’s cloud doesn’t hold your Telegram session.
  • Your sign-in details stay out of the agent. The browser encrypts your phone number, code, and password for that sign-in. They don’t enter prompts, logs, or configuration.

Disconnecting stops and uninstalls the listener. It doesn’t sign the device out of Telegram.

Before you retire the machine, run this on it to revoke the session and remove local state:

Terminal
npx -y @alfe.ai/openclaw-telegram logout --agent-id <AGENT_ID>