koibot
Version:
KoiBot - 一个基于 node-napcat-ts 的 QQ 机器人
86 lines (68 loc) • 1.54 kB
Markdown
使用方法:
1. 下载并配置 napcat, 并配置 NapCat 端为 websocket 服务端
[](https://napneko.github.io/)
2. [napcat]/config/onebot11_*.json 文件内容如下
```json
{
"network": {
"httpServers": [],
"httpClients": [],
"websocketServers": [
{
"name": "main",
"enable": true,
"host": "0.0.0.0",
"port": 3001,
"messagePostFormat": "array",
"reportSelfMessage": false,
"token": "",
"enableForcePushEvent": true,
"debug": false,
"heartInterval": 30000
}
],
"websocketClients": []
},
"musicSignUrl": "",
"enableLocalFile2Url": false
}
```
3. 下载该项目
```
npm install koibot
cnpm install koibot
```
4. 安装依赖
```
npm install
cnpm install
```
5. 填写 config.yaml 文件
```yaml
napcat:
baseUrl: 'ws://localhost:3001'
accessToken: ''
throwPromise: false
reconnection:
enable: true
attempts: 10
delay: 5000
debug: false
self:
master: []
```
6. 创建 app.ts 文件, 填写内容如下
```ts
// [koibot]/app.ts
import {Bot} from "./src/index.ts";
new Bot().start()
```
7. koibot 启动!
```
npm start
or
npx jiti app.js
```