Files
cwd/docs/function/telegram-notify.md
anghunk e1568f60ff feat(telegram): 新增 Telegram 机器人通知与快捷审核功能
- 新增 Telegram 通知功能,支持通过机器人接收新评论通知
- 在 Telegram 消息中提供“批准”和“删除”按钮,支持快捷审核
- 新增后台 Telegram 设置页面,支持配置 Bot Token、Chat ID 和开关
- 新增 `/api/telegram/webhook` 端点处理按钮回调
- 更新邮件通知逻辑,统一使用评论设置中的 `adminEmail` 作为收件人
- 更新相关文档,包括功能说明和 API 文档
2026-01-30 17:49:47 +08:00

34 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Telegram 通知与交互
系统支持通过 Telegram 机器人接收新评论通知,并在 Telegram 中对评论进行批准或删除操作。
## 功能特性
1. **实时通知**:新评论会立即推送到指定的 Telegram 账号或群组。
2. **快捷审核**:通知消息包含“批准”和“删除”按钮,无需登录后台即可审核。
## 配置步骤
1. **创建机器人**
- 在 Telegram 中搜索 `@BotFather`
- 发送 `/newbot` 命令,按照提示创建新机器人。
- 获取 **API Token**
2. **获取 Chat ID**
- 如果是个人接收,给你的机器人发送一条消息。
- 访问 `https://api.telegram.org/bot<YourBOTToken>/getUpdates` 查看 `chat.id`
- 或者使用 `@userinfobot` 获取你的 ID。
- 如果是群组,将机器人拉入群组,并获取群组 ID通常以 `-` 开头)。
3. **后台设置**
- 登录评论系统后台。
- 进入“设置” -> “Telegram 通知设置”。
- 填入 **Bot Token****Chat ID**
- 开启 **Telegram 通知** 开关。
- 点击 **保存**
- 点击 **一键设置 Webhook**(重要:必须执行此步骤,机器人才能接收按钮点击事件)。
## 使用说明
- **审核**:点击消息下方的按钮即可(批准 / 删除)。