🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

openclaw-channel-telegram-userbot

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openclaw-channel-telegram-userbot

OpenClaw channel plugin — Telegram userbot via MTProto (GramJS)

latest
Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
5
-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

openclaw-channel-telegram-userbot

OpenClaw channel plugin that connects your personal Telegram account (not a bot) to OpenClaw via MTProto. Your AI assistant responds as you — from your real Telegram account.

Features

  • MTProto via GramJS — full Telegram user API, not the limited Bot API
  • Media support — photos, videos, documents, voice, stickers, animations (inbound & outbound)
  • Reply context — AI sees the quoted message when someone replies
  • Conversation memory — multi-turn context with configurable history depth, persisted to disk
  • System prompts — per-chat or global system prompt for AI personality
  • Markdown formatting — bold, italic, code, strikethrough, spoilers in AI responses
  • DM and group chat support — with configurable mention requirements
  • Machine-bound session encryption — AES-256-GCM, sessions are useless on another device
  • Human-like reply delay — configurable pause + typing indicator before responding
  • Chat allowlist / denylist — control which chats the assistant can access
  • Per-group settings — different behavior for different groups

Requirements

  • OpenClaw >= 2026.3.0
  • Telegram API credentials from my.telegram.org
  • Bun >= 1.0 or Node.js >= 22

Installation

openclaw plugins install openclaw-channel-telegram-userbot

Setup

1. Get Telegram API credentials

Go to my.telegram.org, create an app, and note the api_id and api_hash.

2. Generate session string

cd openclaw-channel-telegram-userbot
bun run src/auth.ts

Follow the prompts to log in. You'll receive a session string (optionally encrypted with your machine ID).

3. Configure OpenClaw

openclaw config set channels.telegram-userbot.apiId 12345678
openclaw config set channels.telegram-userbot.apiHash "your_api_hash"
openclaw config set channels.telegram-userbot.sessionString "your_session_string"

Or add to ~/.openclaw/openclaw.json:

{
  channels: {
    "telegram-userbot": {
      apiId: 12345678,
      apiHash: "abc123...",
      sessionString: "1BQA...",
      allowFrom: ["*"],
      replyDelaySec: 2,
      groups: {
        "*": { requireMention: true }
      }
    }
  }
}

4. Enable and restart

openclaw plugins enable telegram-userbot

Configuration

KeyTypeDefaultDescription
apiIdnumberrequiredTelegram API ID
apiHashstringrequiredTelegram API Hash
sessionStringstringrequiredGramJS session (from auth helper)
allowFromstring[]["*"]Allowed chat IDs (* = all)
denyFromstring[][]Denied chat IDs (overrides allowFrom)
replyDelaySecnumber2Delay before reply (seconds)
groupsobject{}Per-group settings
groups.*.requireMentionbooleanfalseOnly respond when mentioned
groups.*.enabledbooleantrueEnable/disable group
conversations.maxMessagesnumber20Max messages per chat history
conversations.defaultSystemPromptstring""System prompt for all chats
conversations.systemPromptsobject{}Per-chat system prompts
conversations.dataDirstring~/.openclaw/telegram-userbotHistory storage path

Security

Session strings are encrypted with your machine's hardware ID by default (AES-256-GCM via node-machine-id). Encrypted sessions are useless if copied to another machine.

Override with a custom key:

export OPENCLAW_TELEGRAM_SESSION_KEY=my-secret-key

Conversation data: History is stored in ~/.openclaw/telegram-userbot/ as JSON files. These may contain sensitive chat content. Ensure appropriate file permissions on multi-user systems.

Recommendations:

  • Use a secondary Telegram account
  • Check Telegram → Settings → Devices periodically
  • Use allowFrom / denyFrom to limit access
  • Set replyDelaySec > 0 to avoid rate limits

Development

bun install
bun run lint         # check code with Biome
bun run lint:fix     # auto-fix
bun run typecheck    # TypeScript check
bun test             # run tests

License

MIT

Keywords

openclaw

FAQs

Package last updated on 10 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts