{
  "schemaVersion": "1.0",
  "item": {
    "slug": "telegram-pairing-customization",
    "name": "总是响应未配对用户的 /start 消息 | Always respond to /start messages from unpaired users",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/crazypeace/telegram-pairing-customization",
    "canonicalUrl": "https://clawhub.ai/crazypeace/telegram-pairing-customization",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/telegram-pairing-customization",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=telegram-pairing-customization",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/telegram-pairing-customization"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/telegram-pairing-customization",
    "agentPageUrl": "https://openagent3.xyz/skills/telegram-pairing-customization/agent",
    "manifestUrl": "https://openagent3.xyz/skills/telegram-pairing-customization/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/telegram-pairing-customization/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "概述",
        "body": "此技能描述如何修改 OpenClaw 的 Telegram 配对逻辑，使未批准的用户在配对被批准前，每次发送 /start 消息时都能收到配对码回复。"
      },
      {
        "title": "何时使用此技能",
        "body": "需要让未批准的用户每次发送 /start 都收到配对消息（而非仅首次）\n用户可能错过首次配对消息，需要重新获取配对码\n提升用户体验，确保用户始终能获得配对指引"
      },
      {
        "title": "1. 找到需要修改的文件",
        "body": "在你正在运行的代码中搜索下面的代码段\n\nif (created) {\n  logger.info({\n    chatId: candidate,\n    username: from?.username,\n    firstName: from?.first_name,\n    lastName: from?.last_name,\n    matchKey: allowMatch.matchKey ?? \"none\",\n    matchSource: allowMatch.matchSource ?? \"none\"\n  }, \"telegram pairing request\");\n  await withTelegramApiErrorLogging({\n    operation: \"sendMessage\",\n    fn: () => bot.api.sendMessage(chatId, [\n      \"OpenClaw: access not configured.\",\n      \"\",\n      `Your Telegram user id: ${telegramUserId}`,\n      \"\",\n      `Pairing code: ${code}`,\n      \"\",\n      \"Ask the bot owner to approve with:\",\n      formatCliCommand(\"openclaw pairing approve telegram <code>\")\n    ].join(\"\\n\"))\n  });\n}"
      },
      {
        "title": "2. 实施修改",
        "body": "将条件判断从 if (created) 修改为 if (code):\n\nif (do) { // <-- 关键修改点\n  logger.info({\n    chatId: candidate,\n    username: from?.username,\n    firstName: from?.first_name,\n    lastName: from?.last_name,\n    matchKey: allowMatch.matchKey ?? \"none\",\n    matchSource: allowMatch.matchSource ?? \"none\"\n  }, \"telegram pairing request\");\n  await withTelegramApiErrorLogging({\n    operation: \"sendMessage\",\n    fn: () => bot.api.sendMessage(chatId, [\n      \"OpenClaw: access not configured.\",\n      \"\",\n      `Your Telegram user id: ${telegramUserId}`,\n      \"\",\n      `Pairing code: ${code}`,\n      \"\",\n      \"Ask the bot owner to approve with:\",\n      formatCliCommand(\"openclaw pairing approve telegram <code>\")\n    ].join(\"\\n\"))\n  });\n}"
      },
      {
        "title": "3. 重启服务",
        "body": "修改完成后需要重启 OpenClaw 服务以使更改生效:\n\nopenclaw gateway restart"
      },
      {
        "title": "一些建议",
        "body": "在寻找需要修改的文件时, 建议先搜索 Ask the bot owner to approve with: 可以帮助你先大幅缩小处理范围, 过滤出最有可能的几个文件.\n\n一个建议的起始目录为 /usr/lib/node_modules/openclaw/"
      },
      {
        "title": "工作原理",
        "body": "upsertTelegramPairingRequest 函数返回 {code, created} 对象\n当用户首次请求配对时：created: true，有配对码\n当用户再次请求配对时：created: false，但仍有相同的配对码（只要配对请求未过期或未被批准）\n通过检查 if (code) 而不是 if (created)，确保用户每次请求都能收到有效的配对码"
      },
      {
        "title": "验证修改",
        "body": "让未配对的用户发送 /start 命令\n确认用户收到配对码消息\n再次发送 /start 命令，确认用户再次收到相同的配对码"
      },
      {
        "title": "注意事项",
        "body": "修改系统文件前务必备份原始文件\n修改后的文件在 OpenClaw 更新时可能会被覆盖，需要重新应用修改\n需要适当的文件系统权限来修改 OpenClaw 的安装文件\n修改后应测试以确保功能正常"
      },
      {
        "title": "故障排除",
        "body": "如果修改不生效，请确认是否正确重启了 OpenClaw 服务\n如果找不到文件路径，请确认 OpenClaw 的实际安装路径\n如果权限不足，请使用适当的权限提升方法（如 sudo）\n如需回滚，请使用备份文件替换修改后的文件"
      }
    ],
    "body": "Telegram 配对消息持续响应技能\n概述\n\n此技能描述如何修改 OpenClaw 的 Telegram 配对逻辑，使未批准的用户在配对被批准前，每次发送 /start 消息时都能收到配对码回复。\n\n何时使用此技能\n需要让未批准的用户每次发送 /start 都收到配对消息（而非仅首次）\n用户可能错过首次配对消息，需要重新获取配对码\n提升用户体验，确保用户始终能获得配对指引\n执行步骤\n1. 找到需要修改的文件\n\n在你正在运行的代码中搜索下面的代码段\n\nif (created) {\n  logger.info({\n    chatId: candidate,\n    username: from?.username,\n    firstName: from?.first_name,\n    lastName: from?.last_name,\n    matchKey: allowMatch.matchKey ?? \"none\",\n    matchSource: allowMatch.matchSource ?? \"none\"\n  }, \"telegram pairing request\");\n  await withTelegramApiErrorLogging({\n    operation: \"sendMessage\",\n    fn: () => bot.api.sendMessage(chatId, [\n      \"OpenClaw: access not configured.\",\n      \"\",\n      `Your Telegram user id: ${telegramUserId}`,\n      \"\",\n      `Pairing code: ${code}`,\n      \"\",\n      \"Ask the bot owner to approve with:\",\n      formatCliCommand(\"openclaw pairing approve telegram <code>\")\n    ].join(\"\\n\"))\n  });\n}\n\n2. 实施修改\n\n将条件判断从 if (created) 修改为 if (code):\n\nif (do) { // <-- 关键修改点\n  logger.info({\n    chatId: candidate,\n    username: from?.username,\n    firstName: from?.first_name,\n    lastName: from?.last_name,\n    matchKey: allowMatch.matchKey ?? \"none\",\n    matchSource: allowMatch.matchSource ?? \"none\"\n  }, \"telegram pairing request\");\n  await withTelegramApiErrorLogging({\n    operation: \"sendMessage\",\n    fn: () => bot.api.sendMessage(chatId, [\n      \"OpenClaw: access not configured.\",\n      \"\",\n      `Your Telegram user id: ${telegramUserId}`,\n      \"\",\n      `Pairing code: ${code}`,\n      \"\",\n      \"Ask the bot owner to approve with:\",\n      formatCliCommand(\"openclaw pairing approve telegram <code>\")\n    ].join(\"\\n\"))\n  });\n}\n\n3. 重启服务\n\n修改完成后需要重启 OpenClaw 服务以使更改生效:\n\nopenclaw gateway restart\n\n一些建议\n\n在寻找需要修改的文件时, 建议先搜索 Ask the bot owner to approve with: 可以帮助你先大幅缩小处理范围, 过滤出最有可能的几个文件.\n\n一个建议的起始目录为 /usr/lib/node_modules/openclaw/\n\n工作原理\nupsertTelegramPairingRequest 函数返回 {code, created} 对象\n当用户首次请求配对时：created: true，有配对码\n当用户再次请求配对时：created: false，但仍有相同的配对码（只要配对请求未过期或未被批准）\n通过检查 if (code) 而不是 if (created)，确保用户每次请求都能收到有效的配对码\n验证修改\n让未配对的用户发送 /start 命令\n确认用户收到配对码消息\n再次发送 /start 命令，确认用户再次收到相同的配对码\n注意事项\n修改系统文件前务必备份原始文件\n修改后的文件在 OpenClaw 更新时可能会被覆盖，需要重新应用修改\n需要适当的文件系统权限来修改 OpenClaw 的安装文件\n修改后应测试以确保功能正常\n故障排除\n如果修改不生效，请确认是否正确重启了 OpenClaw 服务\n如果找不到文件路径，请确认 OpenClaw 的实际安装路径\n如果权限不足，请使用适当的权限提升方法（如 sudo）\n如需回滚，请使用备份文件替换修改后的文件"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/crazypeace/telegram-pairing-customization",
    "publisherUrl": "https://clawhub.ai/crazypeace/telegram-pairing-customization",
    "owner": "crazypeace",
    "version": "1.0.4",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/telegram-pairing-customization",
    "downloadUrl": "https://openagent3.xyz/downloads/telegram-pairing-customization",
    "agentUrl": "https://openagent3.xyz/skills/telegram-pairing-customization/agent",
    "manifestUrl": "https://openagent3.xyz/skills/telegram-pairing-customization/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/telegram-pairing-customization/agent.md"
  }
}