feat: 通知脚本支持 Telegram 通道 #96

Merged
gjm merged 1 commits from company-desktop/company-desktop-computer/feat-notify-telegram AGit into main 2026-10-28 15:58:10 +08:00
Collaborator

用户没有企业微信,改用 Telegram Bot。同一台机器的 api.telegram.org 需要走本地代理
(实测 127.0.0.1:7897),所以发送逻辑要显式支持代理。

  • notify.json 新增 telegram 段:token / chatId / proxy
    (也认环境变量 PI_NOTIFY_TELEGRAM_TOKEN、PI_NOTIFY_TELEGRAM_CHAT)
  • 未配置 proxy 时回落 HTTPS_PROXY 环境变量,再回落系统(IE)代理
  • 文本超过 3900 字符截断(Telegram 上限 4096)
  • 自检 -Probe 同时报告 webhook 与 telegram 两个通道的结果,token 只显示前 10 位
  • SKILL.md 更新通道配置说明,补上 notify.json 的完整示例与代理注意事项

实测:假 token 时返回 "(401) 未经授权",说明请求确实穿过了代理到达 api.telegram.org,
只是凭据无效;未配置时正确报告 not configured。真实推送待用户提供 bot token。

用户没有企业微信,改用 Telegram Bot。同一台机器的 api.telegram.org 需要走本地代理 (实测 127.0.0.1:7897),所以发送逻辑要显式支持代理。 - notify.json 新增 telegram 段:token / chatId / proxy (也认环境变量 PI_NOTIFY_TELEGRAM_TOKEN、PI_NOTIFY_TELEGRAM_CHAT) - 未配置 proxy 时回落 HTTPS_PROXY 环境变量,再回落系统(IE)代理 - 文本超过 3900 字符截断(Telegram 上限 4096) - 自检 -Probe 同时报告 webhook 与 telegram 两个通道的结果,token 只显示前 10 位 - SKILL.md 更新通道配置说明,补上 notify.json 的完整示例与代理注意事项 实测:假 token 时返回 "(401) 未经授权",说明请求确实穿过了代理到达 api.telegram.org, 只是凭据无效;未配置时正确报告 not configured。真实推送待用户提供 bot token。
company-desktop added 1 commit 2026-10-28 15:55:15 +08:00
用户没有企业微信,改用 Telegram Bot。同一台机器的 api.telegram.org 需要走本地代理
(实测 127.0.0.1:7897),所以发送逻辑要显式支持代理。

- notify.json 新增 telegram 段:token / chatId / proxy
  (也认环境变量 PI_NOTIFY_TELEGRAM_TOKEN、PI_NOTIFY_TELEGRAM_CHAT)
- 未配置 proxy 时回落 HTTPS_PROXY 环境变量,再回落系统(IE)代理
- 文本超过 3900 字符截断(Telegram 上限 4096)
- 自检 -Probe 同时报告 webhook 与 telegram 两个通道的结果,token 只显示前 10 位
- SKILL.md 更新通道配置说明,补上 notify.json 的完整示例与代理注意事项

实测:假 token 时返回 "(401) 未经授权",说明请求确实穿过了代理到达 api.telegram.org,
只是凭据无效;未配置时正确报告 not configured。真实推送待用户提供 bot token。
gjm merged commit 4f2833fd91 into main 2026-10-28 15:58:10 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gjm/envi-code#96