Files
blog/bot/README.md
T
2026-06-01 17:57:22 +08:00

47 lines
957 B
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.
# WriteBot
纯 Node.js,零 npm 依赖。后台管理 `write` 开发服务,提供 Web 控制面板 + Telegram 机器人。
## 快速开始
### 1. 配置
```powershell
cd bot
copy .env.example .env
```
### 2. 启动
```powershell
node index.js
```
或双击 `start.bat`。
### 3. 控制面板
浏览器打开:`http://127.0.0.1:8017/`
一键启动/停止 Write、查看状态、复制局域网地址。
### 4. Telegram 机器人
1. 联系 [@BotFather](https://t.me/BotFather),`/newbot` 获得 token。
2. 联系 [@userinfobot](https://t.me/userinfobot) 获得 chat id。
3. 填入 `.env`。
命令:`/start` `/stop` `/status` `/ip` `/help`
## 开机自启
已配好启动文件夹的快捷方式(WriteBot.lnk)。开机登录后自动启动。
## 防火墙
首次手机访问不了要放行 8016:
```powershell
New-NetFirewallRule -DisplayName "Write Dev 8016" -Direction Inbound -Protocol TCP -LocalPort 8016 -Action Allow
```