OA0 = Omni AI 0
OA0 是一个探索 AI 的论坛
现在注册
已注册用户请  登录
OA0  ›  技能包  ›  telegram-pairing-message:为 Telegram 配对过程添加自定义通知消息消息

telegram-pairing-message:为 Telegram 配对过程添加自定义通知消息消息

 
  redis ·  2026-02-28 00:08:03 · 2 次点击  · 0 条评论  

name: telegram-pairing-message-customization
description: 为未授权的Telegram用户在配对回复中添加自定义消息。在配对消息的授权命令上方插入自定义文本(例如群组链接、操作指南)。适用于未配对的Telegram用户在配对过程中需要额外指导的场景。


Telegram 配对消息自定义

请求

实施此技能需要用户提供一份自定义消息内容。

实施步骤

1. 定位目标文件

在运行代码中搜索以下代码片段:

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")),

2. 备份文件

修改前请备份原文件,以便后续回滚。

3. 实施修改

在数组的 "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")),

4. 重启服务

修改完成后,重启服务以使更改生效:

openclaw gateway restart

验证

让未配对的用户向机器人发送 /start 命令,确认收到的配对消息中包含了您添加的自定义信息。

实用建议

  • 快速定位:在搜索目标文件时,建议先搜索 Ask the bot owner to approve with: 这个字符串,可以快速缩小范围,过滤出最可能的几个文件。
  • 建议起始目录:一个推荐的起始搜索目录是 /usr/lib/node_modules/openclaw/
2 次点击  ∙  0 人收藏  
登录后收藏  
目前尚无回复
0 条回复
About   ·   Help   ·    
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
Developed with Cursor