revx-telegram

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Telegram Connector (
revx connector telegram
)

Telegram 连接器(
revx connector telegram

Configure Telegram bot integrations for alert notifications from monitors and the grid bot.
Auth required. Make sure
revx
is installed and configured before running these commands. If any command fails with an auth-related error —
Auth not configured
,
No private key found
,
Authentication failed (401)
,
Invalid signature
,
insecure permissions
, or a missing key/config file at
~/.config/revolut-x/
invoke the
revx-auth
skill immediately and apply the fix yourself.
Do not interrupt the user to ask them to run setup. Only escalate to the user for steps only they can perform (pasting the API key, registering the public key in their Revolut X profile, choosing a passphrase). After the fix, retry the original command.

配置Telegram机器人集成,以接收来自监控器和网格机器人的警报通知。
需要身份验证。运行这些命令前,请确保已安装并配置
revx
。如果任何命令因身份验证相关错误失败——例如
Auth not configured
No private key found
Authentication failed (401)
Invalid signature
insecure permissions
,或者
~/.config/revolut-x/
路径下缺少密钥/配置文件——请立即调用
revx-auth
技能并自行修复。不要打断用户让他们运行设置步骤。仅在需要用户亲自执行的步骤(如粘贴API密钥、在Revolut X个人资料中注册公钥、选择密码短语)时才向用户求助。修复后,重试原命令。

Add a Connection

添加连接

bash
revx connector telegram add --token <bot-token> --chat-id <chat-id>
revx connector telegram add --token <token> --chat-id <id> --label prod --test
FlagDescription
--token <token>
Telegram Bot API token (required)
--chat-id <id>
Telegram chat ID (required)
--label <name>
Connection label (default: "default")
--test
Send test message after adding
bash
revx connector telegram add --token <bot-token> --chat-id <chat-id>
revx connector telegram add --token <token> --chat-id <id> --label prod --test
参数描述
--token <token>
Telegram Bot API令牌(必填)
--chat-id <id>
Telegram聊天ID(必填)
--label <name>
连接标签(默认值:"default")
--test
添加后发送测试消息

Behavioral Instructions for Claude

Claude行为指令

When the user wants to set up Telegram notifications, they need two things: a bot token and a chat ID. If either is missing, walk them through the setup below. Share the relevant steps as a message the user can follow — do not attempt to perform these steps via tools, as they require the user's Telegram app.
当用户想要设置Telegram通知时,他们需要两样东西:机器人令牌(bot token)聊天ID(chat ID)。如果其中任何一项缺失,请引导他们完成以下设置步骤。将相关步骤作为用户可遵循的消息分享——不要尝试通过工具执行这些步骤,因为它们需要用户使用Telegram应用。

Setup Guide: Getting a Bot Token and Chat ID

设置指南:获取机器人令牌和聊天ID

Share the following instructions with the user when they need help setting up Telegram:
Step 1 — Create a Telegram Bot (to get the bot token):
  1. Open Telegram (mobile or desktop)
  2. Search for @BotFather and start a chat
  3. Send
    /newbot
  4. BotFather will ask for a display name (e.g., "My RevX Alerts") — type any name
  5. BotFather will ask for a username ending in
    bot
    (e.g.,
    my_revx_alerts_bot
    ) — must be unique
  6. BotFather replies with your bot token — it looks like
    123456789:ABCdefGHI-jklMNOpqrSTUvwxYZ
  7. Copy the token and share it back here
Step 2 — Get your Chat ID:
  1. Open Telegram and find your new bot (search for the username you just created)
  2. Send any message to the bot (e.g., "hello")
  3. Open this URL in a browser — replace
    <YOUR_TOKEN>
    with the token from Step 1:
    https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
  4. In the JSON response, find
    "chat":{"id": <number>}
    — that number is your chat ID
  5. It's usually a positive number for personal chats (e.g.,
    123456789
    ) or a negative number for group chats (e.g.,
    -1001234567890
    )
  6. Copy the chat ID and share it back here
Step 3 — Add the connection (Claude runs this):
Once the user provides both values, run:
bash
revx connector telegram add --token <bot-token> --chat-id <chat-id> --test
The
--test
flag sends a test message to verify the connection works. If the test succeeds, the setup is complete.
Troubleshooting:
  • "chat not found" or empty
    getUpdates
    response — the user must send a message to the bot first, then retry the URL
  • "Unauthorized" — the token is incorrect, ask the user to copy it again from BotFather
  • For group chats: the bot must be added to the group as a member, then someone must send a message in the group before
    getUpdates
    shows the group chat ID

当用户需要Telegram设置帮助时,分享以下说明:
步骤1 — 创建Telegram机器人(获取机器人令牌):
  1. 打开Telegram(移动端或桌面端)
  2. 搜索**@BotFather**并开始对话
  3. 发送
    /newbot
  4. BotFather会要求输入显示名称(例如:"My RevX Alerts")——输入任意名称即可
  5. BotFather会要求输入以
    bot
    结尾的用户名(例如:
    my_revx_alerts_bot
    )——必须唯一
  6. BotFather会回复你的机器人令牌——格式类似
    123456789:ABCdefGHI-jklMNOpqrSTUvwxYZ
  7. 复制令牌并在此处分享
步骤2 — 获取聊天ID:
  1. 打开Telegram,找到你刚创建的机器人(搜索你设置的用户名)
  2. 向机器人发送任意消息(例如:"hello")
  3. 在浏览器中打开以下URL——将
    <YOUR_TOKEN>
    替换为步骤1中获取的令牌:
    https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
  4. 在JSON响应中,找到
    "chat":{"id": <number>}
    ——这个数字就是你的聊天ID
  5. 个人聊天通常是正数(例如:
    123456789
    ),群组聊天通常是负数(例如:
    -1001234567890
  6. 复制聊天ID并在此处分享
步骤3 — 添加连接(由Claude执行):
一旦用户提供了这两个值,运行:
bash
revx connector telegram add --token <bot-token> --chat-id <chat-id> --test
--test
参数会发送一条测试消息以验证连接是否正常工作。如果测试成功,设置即完成。
故障排除:
  • "chat not found"或
    getUpdates
    响应为空——用户必须先向机器人发送消息,然后重试该URL
  • "Unauthorized"——令牌不正确,请让用户重新从BotFather复制令牌
  • 对于群组聊天:必须将机器人添加为群组成员,然后有人在群组中发送消息后,
    getUpdates
    才会显示群组聊天ID

Manage Connections

管理连接

bash
revx connector telegram list                       # List all connections
revx connector telegram test <connection-id>       # Send test message
revx connector telegram test <id> --message "Custom test"
revx connector telegram enable <connection-id>     # Enable connection
revx connector telegram disable <connection-id>    # Disable connection
revx connector telegram delete <connection-id>     # Delete connection

bash
revx connector telegram list                       # 列出所有连接
revx connector telegram test <connection-id>       # 发送测试消息
revx connector telegram test <id> --message "Custom test"
revx connector telegram enable <connection-id>     # 启用连接
revx connector telegram disable <connection-id>    # 禁用连接
revx connector telegram delete <connection-id>     # 删除连接

How Notifications Work

通知工作原理

Once a Telegram connection is configured and enabled:
  • Monitor alerts (see
    revx-monitor
    skill) are automatically sent as Telegram messages when triggered
  • Grid bot events (see
    revx-strategy
    skill) send notifications on startup, shutdown, fills, and P&L changes
No additional configuration is needed — active monitors and the grid bot detect enabled Telegram connections automatically.

一旦Telegram连接配置完成并启用:
  • 监控器警报(参见
    revx-monitor
    技能)触发时会自动以Telegram消息形式发送
  • 网格机器人事件(参见
    revx-strategy
    技能)会在启动、关闭、成交以及盈亏变化时发送通知
无需额外配置——活动的监控器和网格机器人会自动检测已启用的Telegram连接。

Related Skills

相关技能

SkillPurpose
revx-monitor
Set up price/indicator alerts that notify via Telegram
revx-strategy
Grid bot sends trade notifications via Telegram
revx-auth
API key setup and configuration
技能用途
revx-monitor
设置通过Telegram通知的价格/指标警报
revx-strategy
网格机器人通过Telegram发送交易通知
revx-auth
API密钥设置与配置