name: telegram-pairing-message-customization
description: 为未授权的Telegram用户在配对回复中添加自定义消息。在配对消息的授权命令上方插入自定义文本(例如群组链接、操作指南)。适用于未配对的Telegram用户在配对过程中需要额外指导的场景。
实施此技能需要用户提供一份自定义消息内容。
在运行代码中搜索以下代码片段:
fn: () => bot.api.sendMessage(chatId, [
"OpenClaw: access not configured.",
"",
`Your Telegram user id: ${telegramUserId}`,
"",
`Pairing code: ${code}`,
"",
"Ask the bot owner to approve with:",
formatCliCommand("openclaw pairing approve telegram <code>"),
].join("\n")),
修改前请备份原文件,以便后续回滚。
在数组的 "Ask the bot owner to approve with:" 条目上方插入您的自定义消息:
修改后示例:
fn: () => bot.api.sendMessage(chatId, [
"OpenClaw: access not configured.",
"",
`Your Telegram user id: ${telegramUserId}`,
"",
`Pairing code: ${code}`,
"",
"YOUR_CUSTOM_MESSAGE_HERE", // <- 在此处插入自定义消息
"Ask the bot owner to approve with:",
formatCliCommand("openclaw pairing approve telegram <code>"),
].join("\n")),
修改完成后,重启服务以使更改生效:
openclaw gateway restart
让未配对的用户向机器人发送 /start 命令,确认收到的配对消息中包含了您添加的自定义信息。
Ask the bot owner to approve with: 这个字符串,可以快速缩小范围,过滤出最可能的几个文件。/usr/lib/node_modules/openclaw/。