← 返回列表
D

dsh-im-telegram

v1.0.5 · 3 天前发布

Telegram 渠道适配器(dsh-im 插件家族):bot API polling 长连接,免公网;支持内联按钮审批卡片。

deepseek-harnessdshdsh-plugintelegramtelegram-botim-bridge

README

dsh-im-telegram(Telegram 适配器)

Telegram 渠道适配器:Bot API polling 长连接(免公网、NAT 友好),内联按钮审批卡片,文件交付(/log)。

  • 依赖:inject: ['im'](需 dsh-im 核心)

  • 密钥:token: 'env:TELEGRAM_BOT_TOKEN'(找 @BotFather 创建 bot)

  • 测试:npm run test:telegram(8 个,本地假 Bot API 服务器,无需真实 token)
  • 特性

  • polling getUpdates(long-poll,30s),指数退避重连(FR-1.5);401/409 致命错误停止并提示(token 冲突检测 C4)

  • 消息/按钮回调 → 统一模型;图片/文件自动下载到本地临时目录(FR-7.1 落盘)

  • 出站文本 + inline_keyboard 按钮(审批卡片);sendFile 以 document 交付

  • /status 可见连接状态与缺口(FR-9.3)
  • 配置

    yaml
  • id: im-telegram

  • name: 'dsh-im-telegram'
    config:
    token: 'env:TELEGRAM_BOT_TOKEN'
    mode: polling # polling | webhook(webhook 需要公网 HTTPS + webhookUrl)
    查看完整 README →

    版本兼容矩阵

    DSH 版本状态说明
    dsh@0.1.0-rc.6 ✅ 兼容 cordis patch ✅
    dsh@0.1.0 ✅ 兼容 标准 patch ✅
    dsh@0.2.0 ⚠️ 待验证 待实测(API 可能在变)
    dsh@0.3.0+ ❓ 未知 尚未发布

    💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正

    元数据

    License
    MIT
    npm
    dsh-im-telegram
    Repo
    git+https://github.com/shaobeichen/dsh-im-bridge.git
    Engines
    {"node":">=22"}
    Weekly DL
    0
    Monthly DL
    0
    dsh.bundle
    {"bundle":{"patch":"./cordis.patch.yml"}}