dsh-im-telegram
Verifieddsh-im-telegram · v1.0.5 · MIT
Telegram 渠道适配器(dsh-im 插件家族):bot API polling 长连接,免公网;支持内联按钮审批卡片。
Install
dsh plugin add dsh-im-telegram Confirm the layer applied with dsh --profile default --dump-config — see the install guide.
Source
Published to npm without a public repository. Inspect the package contents before installing.
Tags
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)
配置
- id: im-telegram
name: 'dsh-im-telegram'
config:
token: 'env:TELEGRAM_BOT_TOKEN'
mode: polling # polling | webhook(webhook 需要公网 HTTPS + webhookUrl)