Multi-Account Configuration
Guide users through configuring multiple accounts for messaging platforms in OpenClaw.
Supported Platforms
- - Telegram
- WhatsApp
- Discord
- Slack
- Signal
- Other OpenClaw-supported channels
Workflow
Step 1: Identify Platform
Ask the user which platform they want to configure:
"你想配置哪个平台的多账号?支持的选项:Telegram、WhatsApp、Discord、Slack、Signal 等。"
Step 2: Collect Account Information
For each account, collect:
- 1. Account ID/Name - A short identifier (e.g., "work", "personal", "friendA")
- Platform-specific credentials:
- Telegram: Bot Token (from @BotFather)
- WhatsApp: Pairing code or existing credentials
- Discord: Bot Token
- Slack: Bot Token
- Signal: Phone number
Suggest meaningful names based on use case:
- - "work" - 工作相关
- "personal" - 个人使用
- "side-project" - 副业项目
- "family" - 家人群组
Step 3: Get Current Config
Use gateway config.get to retrieve current configuration.
Step 4: Build Updated Config
Structure the configuration following this pattern:
CODEBLOCK0
Step 5: Apply Configuration
Use gateway config.patch to apply the new configuration.
Step 6: Verify
Confirm the configuration was applied successfully and provide next steps.
Configuration Schema Reference
Bindings
Each account needs a binding entry:
CODEBLOCK1
Account Properties
| Property | Type | Description |
|---|
| name | string | Display name for the account |
| enabled |
boolean | Whether the account is active |
| dmPolicy | string | "allowlist", "blocklist", or "open" |
| allowFrom | array | List of allowed sender IDs (for allowlist) |
| botToken | string | Platform-specific token |
| groupPolicy | string | "open", "closed", or "admin-only" |
| streaming | string | "block" or "allow" |
Example: Adding Telegram Work Account
User provides:
- - Platform: Telegram
- Account name: work
- Bot Token: 123456:ABC-DEF...
Configuration to add:
CODEBLOCK2
Important Notes
- 1. Preserve existing accounts - When adding new accounts, merge with existing config
- Get user ID from context - Use the current user's sender ID for allowFrom
- Validate tokens - Ensure tokens are complete and properly formatted
- Restart required - Configuration changes require gateway restart to take effect
- Security - Never log or expose tokens in responses
多账号配置
引导用户在OpenClaw中为消息平台配置多个账号。
支持的平台
- - Telegram
- WhatsApp
- Discord
- Slack
- Signal
- 其他OpenClaw支持的渠道
工作流程
步骤1:识别平台
询问用户想要配置哪个平台:
你想配置哪个平台的多账号?支持的选项:Telegram、WhatsApp、Discord、Slack、Signal 等。
步骤2:收集账号信息
为每个账号收集以下信息:
- 1. 账号ID/名称 - 简短标识符(例如:work、personal、friendA)
- 平台特定凭证:
- Telegram:机器人令牌(来自@BotFather)
- WhatsApp:配对码或现有凭证
- Discord:机器人令牌
- Slack:机器人令牌
- Signal:手机号码
根据使用场景建议有意义的名称:
- - work - 工作相关
- personal - 个人使用
- side-project - 副业项目
- family - 家人群组
步骤3:获取当前配置
使用gateway config.get获取当前配置。
步骤4:构建更新后的配置
按照以下模式构建配置:
json
{
bindings: [
{
agentId: main,
match: {
channel: <平台>,
accountId: <账号ID>
}
}
],
channels: {
<平台>: {
enabled: true,
accounts: {
<账号ID>: {
name: <显示名称>,
enabled: true,
dmPolicy: allowlist,
allowFrom: [<用户ID>],
botToken: <令牌>,
groupPolicy: open,
streaming: block
}
}
}
}
}
步骤5:应用配置
使用gateway config.patch应用新配置。
步骤6:验证
确认配置已成功应用,并提供后续步骤。
配置模式参考
绑定
每个账号需要一个绑定条目:
json
{
agentId: main,
match: {
channel: telegram,
accountId: work
}
}
账号属性
| 属性 | 类型 | 描述 |
|---|
| name | string | 账号的显示名称 |
| enabled |
boolean | 账号是否激活 |
| dmPolicy | string | allowlist(白名单)、blocklist(黑名单)或open(开放) |
| allowFrom | array | 允许的发件人ID列表(用于白名单) |
| botToken | string | 平台特定令牌 |
| groupPolicy | string | open(开放)、closed(关闭)或admin-only(仅管理员) |
| streaming | string | block(阻止)或allow(允许) |
示例:添加Telegram工作账号
用户提供:
- - 平台:Telegram
- 账号名称:work
- 机器人令牌:123456:ABC-DEF...
要添加的配置:
json
{
bindings: [
{
agentId: main,
match: {
channel: telegram,
accountId: work
}
}
],
channels: {
telegram: {
enabled: true,
accounts: {
work: {
name: Work,
enabled: true,
dmPolicy: allowlist,
allowFrom: [USER_ID],
botToken: 123456:ABC-DEF...,
groupPolicy: open,
streaming: block
}
}
}
}
}
重要提示
- 1. 保留现有账号 - 添加新账号时,与现有配置合并
- 从上下文中获取用户ID - 使用当前用户的发件人ID作为allowFrom
- 验证令牌 - 确保令牌完整且格式正确
- 需要重启 - 配置更改需要重启网关才能生效
- 安全性 - 切勿在响应中记录或暴露令牌