14 Commits

Author SHA1 Message Date
Vaghr
96ffd6b492 Update version in README to v5.3 2026-01-06 02:07:22 +08:00
Vaghr
06bcf8f15c Enhance cleanup command and thread probing logic
Added doubleCheckOnMissingThreadId option to probeForumThread function and improved cleanup command handling.
2026-01-06 02:04:14 +08:00
Vaghr
78e7a88a8c Update comment for Telegram bot version 2026-01-06 01:23:40 +08:00
Vaghr
54b12c7a04 Refactor worker.js for improved configuration and error handling
Updated comments and added new constants for better configuration management. Enhanced error handling and improved user verification process.
2026-01-06 01:23:24 +08:00
Vaghr
9085a339ee Update print statement from 'Hello' to 'Goodbye' 2026-01-05 21:17:19 +08:00
Vaghr
f65e9a9aa5 Revise v5.1 update details in README
Refined the important update announcement for v5.1, improving clarity and consistency in the listed fixes and features.
2026-01-05 21:15:15 +08:00
Vaghr
9e4a0d5fd2 Update README for version 5.1 release
Updated version from v4.0 to v5.1 and added important updates.
2026-01-05 21:12:01 +08:00
Vaghr
81dbf539f7 Revise FAQ and remove old update announcement
Updated FAQ section and removed outdated update notice.
2026-01-05 17:02:44 +08:00
Vaghr
2ea97b879f Update bot version and enhance user checks
Updated the bot version and modified the local question bank. Added mandatory username check for private messages and adjusted the /info command to remove full name display.
2026-01-05 16:54:55 +08:00
Vaghr
8b6bbb4128 Update README.md 2025-12-15 16:05:42 +08:00
Vaghr
20f0e58e5f Update update announcement in README.md 2025-12-15 15:51:48 +08:00
Vaghr
7482fd9114 Update README to remove breaking change notice
Removed note about breaking changes from update section.
2025-12-15 15:50:31 +08:00
Vaghr
feeef30ea6 Update README with v4.2 release notes
Added details about the latest update (v4.2) including breaking changes and enhancements.
2025-12-15 15:49:31 +08:00
jin-gubang
7729f443bd Update worker.js (#1)
// 1. 私聊逻辑增加 Username 强制检查,未设置则拦截。
// 2. /info 指令增加显示用户的完整姓名 (Full Name)。
2025-12-15 15:40:57 +08:00
2 changed files with 1276 additions and 124 deletions

View File

@@ -1,4 +1,4 @@
# 🤖 Telegram Private Chatbot (v4.0)
# 🤖 Telegram Private Chatbot (v5.3)
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/jikssha/telegram_private_chatbot)
![GitHub stars](https://img.shields.io/github/stars/jikssha/telegram_private_chatbot?style=social)
@@ -12,6 +12,27 @@
---
<details>
<summary>📢 <b>v5.1 版本重要更新公告 (2026-01-05)</b></summary>
### 主要修复:
- **自动话题修复**:被删除话题用户不再转发到 General会自动新建话题。
- **话题无限循环修复**:针对创建失败添加重试机制,最多重试 3 次。
- **消息路由规范化**:修复字符串与数字混用问题,统一规范化为 String 类型。
- **并发验证加固**:添加验证锁机制,彻底杜绝并发绕过漏洞。
- **数据读取保护**:实现 `safeGetJSON()` 安全读取机制,防止 KV 数据损坏导致崩溃。
- **验证系统重构**改用索引方案完全避免按钮回调截断问题100% 可用。
### 更新功能:
**批量清理工具**/cleanup # 扫描并清理已删除话题的用户数据
### ⚠️ 更新指南:
Fork用户可直接点击sync 更新同步,自动更新
手动部署用户复制worker.js代码到worker,重新部署一次
</details>
---
## 📑 目录 (Table of Contents)
* [✨ 核心特性](#-核心特性)
@@ -54,6 +75,7 @@ v4.0 版本移除了所有不稳定的外部 API 依赖,专注于**极致的
| `/trust` | **永久信任**<br>该用户将永久免除人机验证(永不过期)。 | 熟人、VIP 客户、长期合作伙伴。 |
| `/reset` | **重置验证**<br>强制清除该用户的验证状态,下次需重新验证。 | 测试验证流程,或怀疑账号被盗。 |
| `/info` | **查看信息**<br>显示当前用户的 UID、话题 ID 和链接。 | 查询用户资料。 |
| `/cleanup` | **批量清理**<br>扫描并清理已删除话题的用户数据。 | 清理失效用户。 |
---
@@ -127,17 +149,20 @@ v4.0 版本移除了所有不稳定的外部 API 依赖,专注于**极致的
## ❓ 常见问题 (FAQ)
**Q: 为什么点击验证按钮没有反应?**
**Q1: 为什么点击验证按钮没有反应?**
A: 请检查 Webhook 是否正确设置。必须确保 Telegram 允许发送 `callback_query` 事件。请务必执行上述“最后一步”中的重置操作。
**Q: 为什么机器人无法在群里创建话题?**
**Q2: 为什么机器人无法在群里创建话题?**
A: 请确保1. 群组 ID 正确(-100开头2. 群组已开启 Topics 功能3. 机器人是群管理员且拥有 "Manage Topics" 权限。
**Q: 为什么人机验证能通过收不到转发的消息?**
**Q3: 为什么人机验证能通过收不到转发的消息?**
A: 请仔细检查所有变量名称和id是否准确删除webhook再重新激活。
`(https://api.telegram.org/bot)<YOUR_TOKEN>/deleteWebhook?drop_pending_updates=true (https://api.telegram.org/bot)`
`(https://api.telegram.org/bot)<YOUR_TOKEN>/deleteWebhook?drop_pending_updates=true`
如果依然无法正常转发消息尝试完成所有步骤后最后再添加bot的管理员权限。
**Q4: 为什么webhook设置失败**
A: 如果你设置了自定义域名不成功Webhook 改回 workers.dev 域名再尝试。这种情况是你域名解析失败或者网络环境阻断造成的
---

1365
worker.js

File diff suppressed because it is too large Load Diff