Nenhuma descrição

chendeben 1d8f61dfc0 feat: forward managed account messages to Feishu 3 dias atrás
.vim 1966456fbf Deepsource (#109) 5 anos atrás
admin-web 1d8f61dfc0 feat: forward managed account messages to Feishu 3 dias atrás
assets 71ab35d0ad Changed file permissions 5 anos atrás
tests 1d8f61dfc0 feat: forward managed account messages to Feishu 3 dias atrás
wbb 1d8f61dfc0 feat: forward managed account messages to Feishu 3 dias atrás
.deepsource.toml acf058069e Add .deepsource.toml 5 anos atrás
.dockerignore 8460fb7fa8 fix: exclude deployment secrets from image 2 meses atrás
.gitignore c9c306132f feat: add Telegram administration platform 2 meses atrás
.python-version 516cb180ff fix: don't ignore .python-version 7 meses atrás
AGENTS.md 0e56b008cc fix: restore private chat navigation 2 meses atrás
CODE_OF_CONDUCT.md 71ab35d0ad Changed file permissions 5 anos atrás
CONTRIBUTING.md 71ab35d0ad Changed file permissions 5 anos atrás
Dockerfile c9c306132f feat: add Telegram administration platform 2 meses atrás
LICENSE 96ba66a6ea refactor: License changes etc (#266) 2 anos atrás
LOCAL_SETUP.md 42537f87f7 feat: add Telegram Business assistant 1 mês atrás
README.md 80a37f163f feat: select visible channel subscribers for admin promotion 5 dias atrás
config.env.template 42537f87f7 feat: add Telegram Business assistant 1 mês atrás
docker-compose.yml c9c306132f feat: add Telegram administration platform 2 meses atrás
launcher.py fda014d800 feat: add teacher directory and nearby discovery 2 meses atrás
pyproject.toml 42537f87f7 feat: add Telegram Business assistant 1 mês atrás
sample_config.env 882fc18461 feat: simplify technician consultation and reviews 2 meses atrás
sample_config.py 42537f87f7 feat: add Telegram Business assistant 1 mês atrás
str_gen.py 39e703dd4b Pyrogram 2.0 (#205) 3 anos atrás
uv.lock dd88f06d8f feat: add technician service fulfillment flow 2 meses atrás

README.md

✨ WilliamButcherBot ✨

Telegram Group Manager Bot + Userbot Written In Python Using Pyrogram.

技师咨询与评价

当前版本要求 Python 3.12,产品主流程是:浏览技师与服务信息 → Telegram 私聊 咨询 → 顾客直接评价 → 管理员审核 → 自动发布到技师公开评价话题并参与排行。 平台不处理预约、支付、退款或精确服务地址。

技师服务默认通过 Telegram Mini App 快速创建,入口地址由 SERVICE_TECHNICIAN_MINI_APP_URL 配置。自助接口会校验 Telegram initData 签名并绑定当前技师,不能通过请求参数修改其他技师资料。系统首次启动时会幂等 内置快速到店、快速上门和按小时服务模板;管理员可以继续编辑、停用或归档, 后续启动不会覆盖管理员修改。技师只需确认服务价格、内容、时长、额外费用说明 和公开区域;具体地址由双方私聊。

公开评价使用一个开启“话题”的公开超级群。将 Bot 设为管理员并授予管理话题 权限,然后在后台填写群 Chat ID 和公开用户名;系统会为每位技师自动创建独立 话题,并在评价审核通过后立即发布。

  • /find_technician:浏览技师、服务和公开评价。
  • /technician_profile:技师通过 Mini App 快速发布服务。
  • /review_teacher:顾客选择技师后直接评价,无需服务单或完成确认。
  • /technician_top:从第一条审核评价开始展示排行。

旧 /teacher_*、/my_services 和 /review_qr 命令继续作为兼容入口。

Telegram Business 智能接待

后台“智能接待”可让同一个 Bot 接入多个 Telegram Business 账号,并按连接账号 隔离知识库、客户会话、额度和接待策略。V1 支持结构化 FAQ 自动回答、无可靠 知识时转人工、账号本人回复后暂停、会话摘要、30 天原始消息保留、人工恢复和 可选每日运营简报。群管理仍由 Pyrogram 处理;Business 更新使用官方 Bot API 长轮询,不会接管普通 Bot 私聊。

启用前需要完成两步官方客户端操作:

  1. 在 BotFather 的 Bot Settings 中开启 Business Mode,并在后台重新测试 Token, 确认显示支持 Business Connection。
  2. 由账号本人在 Telegram“设置 → Telegram Business/聊天自动化 → Chatbots”中 连接 Bot,并选择允许接管的聊天范围。系统不能代替账号本人完成连接或范围授权。

然后为 Bot 分配“智能接待专员”角色,在后台配置 OpenAI 兼容的 Base URL、 API Key 和模型,再为每个连接账号分别配置知识库与通知目标。API Key 只保存在 0600 的 Bot 配置文件中并注入对应工作进程,后台接口和日志不会返回明文。 Telegram 原生欢迎语/离线消息继续在账号侧配置;智能接待会忽略这些消息以及 Bot 自己发送的消息,并在官方 24 小时回复窗口外停止发送、通知人工。

频道管理

后台“频道管理”独立于群组管理。先将对应 Bot 设为频道管理员,再等待频道更新 自动登记,或在后台输入频道数字 ID 接入。按需授予 Bot 发布、编辑、删除帖子、 修改频道资料、管理邀请链接和管理员等 Telegram 权限;后台角色还需具备相应的 channel.* 职责权限。上传媒体需要 media.upload 权限和媒体中转群配置。 公开频道若尚未进入 Bot 的 Telegram 本地缓存,手动接入会通过频道用户名补全; 私有频道没有用户名时,需等待 Bot 收到该频道的新帖后再通过 ID 接入。

管理员可以维护频道名称、简介、头像、邀请链接和管理员。添加管理员时可搜索 Telegram 当前可见的频道订阅者,或输入用户数字 ID;查询结果不保证是完整名册。 后台可发布文字或单个媒体帖子,或设置一次性定时发布。发布前可修改或取消定时任务。帖子页记录 Bot 接入后观察到的新帖;编辑和删除会同步到 Telegram。定时发送若结果不明, 任务会停在“待核实”,不会自动重发。旧帖和 Bot 离线期间的消息无法保证补齐。

made-with-python built-with-love
LICENSE Contributors Repository Size
Python Version Issues Forks Stars

Ready to use method

A Support Group and ready-to-use running instance of this bot can be found on Telegram
WilliamButcherBot | WbbSupport

⇝ Requirements ⇜

Python3.9 | Telegram API Key | Telegram Bot Token | MongoDB URI

⇝ Install Locally Or On A VPS ⇜

thehamkercat@arch:~$ git clone https://github.com/thehamkercat/WilliamButcherBot
thehamkercat@arch:~$ cd WilliamButcherBot
thehamkercat@arch:~$ pip3 install -U -r requirements.txt
thehamkercat@arch:~$ cp sample_config.py config.py

Edit config.py with your own values

⇝ Run Directly ⇜

thehamkercat@arch:~$ python3 -m wbb

Generating Pyrogram Session For Heroku

thehamkercat@arch:~$ git clone https://github.com/thehamkercat/WilliamButcherBot
thehamkercat@arch:~$ cd WilliamButcherBot
thehamkercat@arch:~$ pip3 install pyrogram TgCrypto
thehamkercat@arch:~$ python3 str_gen.py

⇝ Docker ⇜

thehamkercat@arch:~$ git clone https://github.com/thehamkercat/WilliamButcherBot
thehamkercat@arch:~$ cd WilliamButcherBot
thehamkercat@arch:~$ cp sample_config.env config.env

Edit config.env with your own values

thehamkercat@arch:~$ sudo docker build . -t wbb
thehamkercat@arch:~$ sudo docker run wbb

⇝ Write new modules ⇜

# Add license text here, get it from below

from wbb import app # This is bot's client
from wbb import app2 # userbot client, import it if module is related to userbot
from pyrogram import filters # pyrogram filters
...


# For /help menu
__MODULE__ = "Module Name"
__HELP__ = "Module help message"


@app.on_message(filters.command("start"))
async def some_function(_, message):
    await message.reply_text("I'm already up!!")

# Many useful functions are in, wbb/utils/, wbb, and wbb/core/

And put that file in wbb/modules/, restart and test your bot.

Discover more awesome plugin add-ons for this repo @WilliamButcherBot-Add-ons.