Feat/ban user support (#5)

* feat: add /ban command to blacklist users

- Create 'blacklist' table in database to store banned user IDs.
- Implement handle_ban to blacklist users by replying to their messages.
- Add check in handle_message to intercept messages from banned users.

* feat: add /unban command to restore user communication

- Implement handle_unban to remove user IDs from the blacklist.
- Allow admins to restore communication by replying to historic
  messages.

* docs: update README.md
This commit is contained in:
EchoZenith
2026-02-01 02:45:30 +08:00
committed by GitHub
parent ae569098f4
commit 819062ae02
2 changed files with 76 additions and 2 deletions

View File

@@ -13,6 +13,9 @@
- **全媒体支持**:支持文字、图片、语音、视频、文件、贴纸等多种消息格式。
- **Docker 化部署**:支持 Docker Compose一键运行环境隔离极致稳定。
- **欢迎语自定义**:自动处理 `/start` 命令,向首次访问的用户发送个性化引导。
- **编辑同步**:用户或管理员修改消息,另一端实时同步更新。
- **同步删除**:使用 `/del` 指令回复消息,双向撤回内容。
- **用户黑名单**:支持 `/ban``/unban` 功能,轻松拦截骚扰信息。
---
@@ -88,4 +91,4 @@ python bot.py
### ​⚖️ 开源协议
​本项目基于 [MIT License](https://github.com/EchoZenith/TelegramContactBot/blob/main/LICENSE) 开源。
​本项目基于 [MIT License](https://github.com/EchoZenith/TelegramContactBot/blob/main/LICENSE) 开源。