
mirai-api-http
Mirai HTTP API (console) plugin
# 安装
# 使用 Mirai Console Loader (opens new window) 安装mirai-api-http
MCL
支持自动更新插件,支持设置插件更新频道等功能
./mcl --update-package net.mamoe:mirai-api-http --channel stable --type plugin
1
# 手动安装mirai-api-http
- 运行 Mirai Console (opens new window) 生成 plugins 文件夹
- 从 Releases (opens new window) 下载
jar
并将其放入plugins
文件夹中
# 开始使用
- 编辑
config/MiraiApiHttp/setting.yml
配置文件 (没有则自行创建) - 启动 Mirai Console (opens new window)
- 记录日志中出现的
authKey
# setting.yml 模板
# 该配置为全局配置,对所有Session有效
# 可选,默认值为0.0.0.0
host: "0.0.0.0"
# 可选,默认值为8080
port: 8080
# 可选,默认由插件第一次启动时随机生成,建议手动指定
authKey: 1234567890
# 可选,缓存大小,默认4096.缓存过小会导致引用回复与撤回消息失败
cacheSize: 4096
# 可选,是否开启websocket,默认关闭,建议通过Session范围的配置设置
enableWebsocket: false
# 可选,配置CORS跨域,默认为*,即允许所有域名
cors:
- "*"
# 消息上报
report:
# 功能总开关
enable: false
# 群消息上报
groupMessage:
report: false
# 好友消息上报
friendMessage:
report: false
# 临时消息上报
tempMessage:
report: false
# 事件上报
eventMessage:
report: false
# 上报URL
destinations: []
# 上报时的额外Header
extraHeaders: {}
# 心跳
heartbeat:
# 功能总开关
enable: false
# 启动延迟
delay: 1000
# 心跳间隔
period: 15000
# 心跳上报URL
destinations: []
# 上报时的额外信息
extraBody: {}
# 上报时的额外头
extraHeaders: {}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56