|
|
2 年 前 | |
|---|---|---|
| .. | ||
| .conf | 4 年 前 | |
| adapter | 2 年 前 | |
| api | 2 年 前 | |
| misc | 4 年 前 | |
| README.md | 3 年 前 | |
home: true heroImage: https://raw.githubusercontent.com/mamoe/mirai/dev/docs/mirai.png tagline: Mirai HTTP API (console) plugin actionText: API文档 actionLink: api/API.html
footerColumn: 2 footerWrap:
mirai-api-httpMCL 支持自动更新插件,支持设置插件更新频道等功能
./mcl --update-package net.mamoe:mirai-api-http --channel stable --type plugin
2.x 版本需要切换到 stable-v2 的 channel
./mcl --update-package net.mamoe:mirai-api-http --channel stable-v2 --type plugin
启动 MCL 完成自动更新和启动
./mcl -u
mirai-api-httpjar并将其放入plugins文件夹中config/MiraiApiHttp/setting.yml配置文件 (没有则自行创建)authKey以下为 2.x 版本模板:
## 配置文件中的值,全为默认值
## 启用的 adapter, 内置有 http, ws, reverse-ws, webhook
adapters:
- http
- ws
## 是否开启认证流程, 若为 true 则建立连接时需要验证 verifyKey
## 建议公网连接时开启
enableVerify: true
verifyKey: 1234567890
## 开启一些调式信息
debug: false
## 是否开启单 session 模式, 若为 true,则自动创建 session 绑定 console 中登录的 bot
## 开启后,接口中任何 sessionKey 不需要传递参数
## 若 console 中有多个 bot 登录,则行为未定义
## 确保 console 中只有一个 bot 登陆时启用
singleMode: false
## 历史消息的缓存大小
## 同时,也是 http adapter 的消息队列容量
cacheSize: 4096
## adapter 的单独配置,键名与 adapters 项配置相同
adapterSettings:
## 详情看 http adapter 使用说明 配置
http:
host: localhost
port: 8080
cors: [*]
## 详情看 websocket adapter 使用说明 配置
ws:
host: localhost
port: 8080
reservedSyncId: -1