闲社服务运行正常AI智能体自动化平台
t

电报自动回复

技能标识:telegram-autopilot

Manage a Telegram userbot autopilot that responds to private messages as the user using AI. Use when the user wants to set up auto-replies on their personal Telegram account, manage allowed contacts, configure AI response style, or send messages/media as themselves. Triggers on "telegram autopilot", "auto reply telegram", "manage my telegram", "respond for me", "telegram userbot", "paid media telegram". Requires secrets — Telegram API credentials (api_id, api_hash), phone number, optional 2FA pa

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.1.1
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

电报自动回复

Telegram 自动导航系统

来源: https://github.com/Shor73/telegram-autopilot
作者: @Shor73
许可协议: MIT

基于人工智能的个人Telegram账户自动导航系统。当用户不在时,可自动回复私人消息。

前置条件

  • - Python 3.10+
  • Telethon:pip3 install telethon
  • Telegram API凭证(来自 https://my.telegram.org 的 apiid + apihash)
  • Anthropic API密钥(用于AI回复)

设置

1. 获取Telegram API凭证

引导用户访问 https://my.telegram.org → API开发工具 → 创建应用。
他们需要:API ID(数字)和 API Hash(字符串)。

2. 登录流程

Telegram登录需要:手机号 → OTP验证码 → 可选的双因素认证密码。

关键点: OTP验证码约60秒后过期。请最小化延迟:

  • - 使用基于文件的验证码交换(脚本每200毫秒轮询文件)
  • 或在本地端口提供简单的网页表单用于即时输入验证码
  • 切勿依赖聊天往返传递验证码——速度太慢

使用用户的凭证运行 scripts/setup.py。该脚本处理:

  1. 1. 请求OTP验证码
  2. 通过文件(enter_code.txt)等待验证码
  3. 如果需要,处理双因素认证密码
  4. 保存会话文件

bash
python3 scripts/setup.py --api-id 12345 --api-hash abc123 --phone +1234567890

会话文件(.session)持久保存认证信息——只需登录一次。

3. 配置联系人

编辑 config.json 以定义允许的联系人:

json
{
contacts: {
username: {
name: 显示名称,
id: 123456789,
tone: 友好,
language: zh
}
},
ai: {
provider: anthropic,
model: claude-sonnet-4-6,
api_key: sk-ant-...,
max_tokens: 300
},
owner: {
name: 所有者名称,
bio: AI角色简要描述,
telegram_id: 123456789
},
notifications: {
bot_token: 可选的通知机器人令牌,
chat_id: 可选的聊天ID
}
}

4. 启动自动导航系统

bash
python3 scripts/autopilot.py --config config.json --session session_name

功能特性

自动回复

  • - 仅回复私人聊天中允许的联系人
  • 回复前将消息标记为已读(自然行为)
  • 模拟与回复长度成正比的输入延迟
  • 维护对话历史以保持上下文

AI角色

  • - 每个联系人可配置系统提示(语气、语言)
  • 从不编造事实——对未知信息回复我会核实后回复您
  • 从不透露自己是AI

通知功能

  • - 通过Telegram机器人将接收到的消息转发给所有者
  • 转发已发送的回复以供监控

付费媒体(仅限频道)

Telegram付费媒体(inputMediaPaidMedia)仅适用于频道,不适用于私人聊天。

发送付费媒体:

  1. 1. 创建一个私密频道
  2. 使用 InputMediaPaidMedia(starsamount=N, extendedmedia=[...]) 发布媒体
  3. 生成邀请链接并发送给接收者

bash
python3 scripts/sendpaidmedia.py --session session_name --target username --photo /path/to/photo.jpg --stars 1

管理命令

停止自动导航系统:终止进程或发送SIGTERM信号。
添加/删除联系人:编辑 config.json 并重启。

架构

telegram-autopilot/
├── SKILL.md
├── scripts/
│ ├── setup.py — 登录流程(OTP + 双因素认证)
│ ├── autopilot.py — 主事件循环
│ ├── sendpaidmedia.py — 通过频道发送付费媒体
│ └── code_server.py — 快速输入OTP的网页表单
└── references/
└── telegram-auth.md — Telegram认证流程文档

所需凭证

密钥用途使用位置
Telegram API ID + HashMTProto客户端认证setup.py, autopilot.py
手机号 + 双因素认证
账户登录(一次性) | setup.py | | AI API密钥 | 回复生成 | autopilot.py | | 机器人令牌(可选) | 所有者通知 | autopilot.py |

所有密钥存储在 config.json 中——切勿提交此文件。

安全与伦理

  • - 会话安全: .session 文件提供对账户的完全访问权限。请像保护密码一样保护它。
  • 透明度: 如果被直接询问是否为AI,AI被指示如实回答。
  • OTP服务器: code_server.py 绑定到 127.0.0.1(仅限本地主机)。切勿将其暴露到网络中。
  • 通知: 该技能可通过机器人将消息转发给所有者。请确保您控制机器人令牌和聊天ID。
  • 速率限制: Telegram可能会限制具有激进自动化行为的账户。自动导航系统使用自然的延迟。
  • 一次一个会话: 只有一个进程可以使用会话文件。在运行其他脚本前停止自动导航系统。
  • 平台政策: 使用用户机器人自动回复可能违反Telegram服务条款。使用风险自负。

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 telegram-autopilot-1776118638 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 telegram-autopilot-1776118638 技能

通过命令行安装

skillhub install telegram-autopilot-1776118638

下载

⬇ 下载 telegram-autopilot v1.1.1(免费)

文件大小: 12.47 KB | 发布时间: 2026-4-15 14:38

v1.1.1 最新 2026-4-15 14:38
Add canonical source URL and author reference
返回顶部