SuperAPI AI 工具集

telegram-telethon

编程与开发

查看项目

更新于 10-15 21:53

技能介绍

用途:通过 Telethon API 实现 Telegram 自动化,覆盖消息收发、聊天监控、频道发布与守护进程触发的 Codex 会话。

主要能力:CLI 提供 list、recent、search、unread、thread、send、edit、delete、forward、mark-read 等消息操作;draft、drafts、draft-send 管理草稿;download 与 transcribe 处理媒体和语音(支持 telegram、groq、whisper 三种方式);publish 完成草稿到频道的发布流程;send/publish 支持 --markdown、--html 与 --schedule(ISO、相对或自然语言时间);lint-channel 检测未渲染的 markdown/HTML。守护进程 tgd.py 按 daemon.yaml 配置的触发器回复静态文本或启动 Codex 会话,会话按聊天持久化。

使用方式:先安装包,cd telegram-telethon 后执行 pip install -e .(含开发工具用 pip install -e ".[dev]")。交互式配置运行 python3 scripts/tg.py setup;无 TTY 场景可用 --api-id、--api-hash、--phone、--code、--password 完成非交互认证。常用命令如 python3 scripts/tg.py status、list、recent "John" --limit 20。守护进程用 python3 scripts/tgd.py start(--foreground 前台运行),日志用 tgd.py logs。读取命令可加 --to-daily、--to-person 写入 Obsidian 笔记。

适用场景:个人或群组消息自动化、频道内容发布与定时投递、语音消息转录、按聊天挂接 Codex 助手。

限制:配置文件位于 ~/.config/telegram-telethon/(config.yaml、daemon.yaml、sessions.json 等);部分能力依赖前置条件,如 groq 需 GROQ_API_KEY,whisper 需 pip install openai-whisper,Telegram 转录属 Premium 功能;--to-daily/--to-person 目前无 --vault 或 --section 覆盖参数;目标笔记路径由 utils/formatting.py 解析;未提供的信息暂未提供。