Create Telegram Agent Skill
This skill helps create a new Telegram agent with complete configuration.
Prerequisites
Before starting, ensure you have:
- A Telegram bot token (from @BotFather)
- The agent's purpose/description
- The desired agent name
Workflow
Step 1: Collect Required Information
Ask the user for:
-
Agent Name (required)
- Must be unique
- Use lowercase letters, digits, and hyphens
- Examples:
healthman,news-bot,task-manager
-
Agent Purpose (required)
- What will this agent do?
- Examples: "Personal health coach", "Daily news summarizer", "Task reminder assistant"
-
Telegram Bot Token (required)
- Format:
1234567890:ABCdefGHIjklMNOpqrSTUvwxyz - Get from @BotFather on Telegram
If user doesn't have a token, provide these steps:
How to Create a Telegram Bot Token:
- Open Telegram and search for @BotFather
- Start a chat with BotFather and send
/newbot - Follow the prompts:
- Enter a name for your bot (display name, e.g., "CookMaster")
- Enter a username for your bot (must end in 'bot', e.g., "cookmaster_bot")
- BotFather will send you a message containing your HTTP API token
- Copy the token (format:
1234567890:ABCdefGHIjklMNOpqrSTUvwxyz)
Important: Keep your token secure. Anyone with your token can control your bot.
- Format:
Step 2: Generate Agent Configuration
Based on user input, prepare the following configurations:
Agent Definition
{
"id": "<agent-id>",
"name": "<Agent Name>",
"workspace": "/Users/<user>/.openclaw/workspace-<agent-id>",
"agentDir": "/Users/<user>/.openclaw/agents/<agent-id>/agent"
}
Telegram Binding
{
"agentId": "<agent-id>",
"match": {
"channel": "telegram",
"accountId": "<bot-id>"
}
}
Telegram Bot Account
"<bot-id>": {
"enabled": true,
"dmPolicy": "pairing",
"botToken": "<full-bot-token>",
"groupPolicy": "allowlist",
"streamMode": "partial"
}
Step 3: Present Configuration for Review
CRITICAL: DO NOT MODIFY openclaw.json DIRECTLY
Present the following to the user in a clear format:
📋 Configuration Summary
The following changes will be made to openclaw.json:
1. Agent Definition (add to agents.list)
{
"id": "<agent-id>",
"name": "<Agent Name>",
"workspace": "/Users/<user>/.openclaw/workspace-<agent-id>",
"agentDir": "/Users/<user>/.openclaw/agents/<agent-id>/agent"
}
2. Telegram Binding (add to bindings)
{
"agentId": "<agent-id>",
"match": {
"channel": "telegram",
"accountId": "<bot-id>"
}
}
3. Telegram Bot Account (add to channels.telegram.accounts)
"<bot-id>": {
"enabled": true,
"dmPolicy": "pairing",
"botToken": "<full-bot-token>",
"groupPolicy": "allowlist",
"streamMode": "partial"
}
4. Agent Responsibilities (suggested for AGENTS.md)
Based on the provided purpose, generate a responsibility description covering:
- Core functions of the agent
- Working methodology
- Relationship with the user
Please confirm to proceed with the modifications. Any adjustments needed?
Step 4: Wait for User Confirmation
Only proceed after user explicitly confirms (e.g., "confirm", "proceed", "execute", "go ahead").
Step 5: Execute Configuration
Once confirmed:
-
Create directories:
mkdir -p /Users/<user>/.openclaw/workspace-<agent-id> mkdir -p /Users/<user>/.openclaw/agents/<agent-id>/agent -
Update openclaw.json:
- Add agent to
agents.list - Add binding to
bindings - Add bot account to
channels.telegram.accounts
- Add agent to
-
Create agent files:
AGENTS.md- Work responsibilities and workflowSOUL.md- Agent personality and values
-
Report completion:
- Show summary of what was created
- Remind user to restart OpenClaw gateway (if applicable)
- Provide next steps (e.g., test the bot)
Important Rules
- Never modify openclaw.json without explicit user confirmation
- Always show the complete configuration changes before applying
- Extract bot ID from token (the number before the colon)
- Create all necessary directories before writing files
- Generate appropriate AGENTS.md and SOUL.md based on the agent's purpose