SuperAPI AI 工具集

revx-telegram

部署与运维

查看项目

更新于 10-16 01:11

技能介绍

用途:为 Revolut X 的监控(monitor)告警和网格机器人(grid bot)配置 Telegram 机器人通知。使用前需先安装并配置 revx;若命令报认证类错误(如 Auth not configured、No private key found、401、Invalid signature、权限不安全或缺少 ~/.config/revolut-x/ 配置文件),应先用 revx-auth 技能修复,仅将只有用户本人可完成的步骤(粘贴 API key、在 Revolut X 资料中注册公钥、选择口令)交还给用户,修复后重试原命令。

主要能力与用法:添加连接需机器人的 token 和 chat id。 revx connector telegram add --token <bot-token> --chat-id <chat-id> revx connector telegram add --token <token> --chat-id <id> --label prod --test 参数:--token 为 Telegram Bot API token(必需);--chat-id 为 Telegram 会话 ID(必需);--label 为连接标签(默认 "default");--test 添加后发送测试消息。

管理连接命令: 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>

获取凭据(由用户在其 Telegram 应用中完成):用 @BotFather 发送 /newbot,设置显示名和以 bot 结尾的唯一用户名,BotFather 会返回形如 123456789:ABCdefGHI-jklMNOpqrSTUvwxYZ 的 token。随后向该机器人发送任意消息,在浏览器打开 https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates,从返回 JSON 中 "chat":{"id": <number>} 取 chat ID(个人会话通常为正数,群组为负数)。用户提供两者后由工具执行:revx connector telegram add --token <bot-token> --chat-id <chat-id> --test。

通知机制:连接配置并启用后,监控告警触发时自动以 Telegram 消息发送;网格机器人在启动、关闭、成交与盈亏变化时发送通知,无需额外配置。

限制与排错:若提示 chat not found 或 getUpdates 为空,需先向机器人发送消息再重试;若 Unauthorized 说明 token 错误,需重新从 BotFather 复制。群组场景需先将机器人加入群组并由成员发送消息后,getUpdates 才会显示群组 chat ID。相关技能包括 revx-monitor、revx-strategy、revx-auth。