TopRank Skills

Home / Claw Skills / Bot / telegram-pairing-customization
Official OpenClaw rules 38%

telegram-pairing-customization

Modify OpenClaw's Telegram pairing logic so unapproved users receive pairing codes on every /start message before approval. Use when users need to repeatedly access pairing codes after the initial request, ensuring consistent access to pairing instructions even if the initial code was missed or lost.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 telegram-pairing-customization 技能。 若已安装,则直接安装 telegram-pairing-customization 技能。

Overview

Skill Key
crazypeace/telegram-pairing-customization
Author
crazypeace
Source Repo
openclaw/skills
Version
-
Source Path
skills/crazypeace/telegram-pairing-customization
Latest Commit SHA
2916a93ed17cd18731b33b002117e6f7f88c4468

Extracted Content

SKILL.md excerpt

# Telegram 配对消息持续响应技能

## 概述
此技能描述如何修改 OpenClaw 的 Telegram 配对逻辑,使未批准的用户在配对被批准前,每次发送 `/start` 消息时都能收到配对码回复。

## 何时使用此技能
- 需要让未批准的用户每次发送 `/start` 都收到配对消息(而非仅首次)
- 用户可能错过首次配对消息,需要重新获取配对码
- 提升用户体验,确保用户始终能获得配对指引

## 执行步骤

### 1. 找到需要修改的文件
在你正在运行的代码中搜索下面的代码段

```
if (created) {
  logger.info({
    chatId: candidate,
    username: from?.username,
    firstName: from?.first_name,
    lastName: from?.last_name,
    matchKey: allowMatch.matchKey ?? "none",
    matchSource: allowMatch.matchSource ?? "none"
  }, "telegram pairing request");
  await withTelegramApiErrorLogging({
    operation: "sendMessage",
    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. 实施修改
将条件判断从 `if (created)` 修改为 `if (code)`:

```
if (do) { // <-- 关键修改点
  logger.info({
    chatId: candidate,
    username: from?.username,
    firstName: from?.first_name,
    lastName: from?.last_name,
    matchKey: allowMatch.matchKey ?? "none",
    matchSource: allowMatch.matchSource ?? "none"
  }, "telegram pairing request");
  await withTelegramApiErrorLogging({
    operation: "sendMessage",
    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"))
  });
}
```


### 3. 重启服务
修改完成后需要重启 OpenClaw 服务以使更改生效:

```bash
openclaw gateway restart
```

## 一些建议
在寻找需要修...

Related Claw Skills