-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.json
342 lines (342 loc) · 9.39 KB
/
config.json
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
{
"listeners": [
{
"address": "0.0.0.0",
"port": 8998,
"https": false
}
],
"db_clients": [
{
"rdbms": "mysql",
"host": "bilibili-mysql",
"port": 3306,
"dbname": "bilibili_database",
"user": "server",
"passwd": "y2A@kw9&",
"is_fast": false,
"number_of_connections": 1,
"timeout": -1.0,
"auto_batch": false
}
],
"redis_clients": [
{
"host": "bilibili-redis",
"port": 6379,
"username": "",
"passwd": "iO81@71",
// "passwd": "",
"db": 0,
"is_fast": false,
"number_of_connections": 1,
"timeout": -1.0
}
],
"custom_config": {
"version": "0.1",
"enabel_private_subscribe": true,
// Is enable private chat live push
"default_fetch_delay": 60,
// 默认获取时间周期 s
"min_fetch_delay": 30,
// 最小获取时间周期
"max_fetch_delay": 100000,
// 最大获取时间周期
"cqhttp": {
"version_format": "Powered by [name] v[ver]",
"bot_name": "小鱼bot",
"command_prefix": "/",
// 命令前缀
"short_help_prefix": " ",
"command": [
{
"name": "subscribe",
// 用于触发帮助 触发方式 help subscribe
"command": "subscribe <uid> [timer]",
// 匹配规则
// 解析后 1为uid 2为时间
// 最后 *为容错
// TODO 增加只匹配前缀成功的提示
"match_rule": "(subscribe) ([0-9]+) ?([0-9]*) *",
// Is Admin Premission Needded
"admin": true,
"short_help": "订阅用户直播间",
"full_help": {
// 详细帮助
"message": [
// 输出信息 分行
"使用方法",
" subscribe <uid> [timer=60]",
"描述",
" 订阅b站用户id为uid的直播房间状态变动",
" 该命令会自动查询b站直播房间rid",
" 该命令默认60s获取一次直播状态",
" 时间范围{30,10000}",
"使用举例",
" subscribe 689460774",
" 订阅直播间30652824",
" 每60s检查一次直播状态",
" 状态变化则推送事件",
" subscribe 689460774 31",
" 每31s检查一次直播状态"
]
}
},
{
"name": "subscriber",
// 触发字符串
"command": "subscriber <rid> [timer]",
"match_rule": "(subscriber) ([0-9]+) ?([0-9]*) *",
// Is Admin Premission Needded
"admin": true,
"short_help": "订阅直播间",
"full_help": {
"message": [
"使用方法",
" subscriber <rid> [timer=60]",
"描述",
" 订阅b站直播间id为rid的直播状态变动",
" 该命令默认60s获取一次直播状态",
"使用举例",
" subscriber 30652824",
" 该命令每60s检查一次直播状态",
" 状态变化则推送事件",
" subscriber 30652824 31",
" 该命令每30s检查一次直播状态"
]
}
},
{
"name": "unsubscribe",
// 触发字符串
"command": "unsubscribe <rid>",
"match_rule": "(unsubscribe) ([0-9]*) *",
// Is Admin Premission Needded
"admin": true,
"short_help": "取消订阅直播间",
"full_help": {
"message": [
"使用方法",
" unsubscribe <rid>",
"描述",
" 取消订阅直播间号为rid的直播间",
"使用举例",
" unsubscribe 30652824",
" 取消鱼鱼的直播间推送"
]
}
},
{
"name": "lists",
// 触发字符串
"command": "lists",
"match_rule": "(lists) *",
// Is Admin Premission Needded
"admin": true,
"short_help": "查看订阅",
"full_help": {
"message": [
"使用方法",
" lists",
"描述",
" 查看该群/该用户的订阅",
" 如果为管理员则查看所有订阅",
"使用举例",
" lists",
" 查看该群/该用户的订阅"
]
}
},
{
"name": "renew",
// 触发字符串
"command": "renew",
"match_rule": "(renew) *",
// Is Admin Premission Needded
"admin": true,
"short_help": "更新缓存",
"full_help": {
"message": [
"使用方法",
" renew",
"描述",
" 清除Redis缓存",
" 重新获取所有订阅",
"使用举例",
" renew",
" 重新获取订阅"
]
}
},
{
"name": "version",
"command": "version",
"match_rule": "(version)",
// Is Admin Premission Needded
"admin": true,
"short_help": "查看版本信息"
// 注意处理 sub_help_messge 为空的命令
// 将无法使用help version
},
{
"name": "help",
// 触发字符串
"command": "help [cmd]",
"match_rule": "(help) ?([a-z]*)",
// Is Admin Premission Needded
"admin": true,
"short_help": "查看帮助[cmd]为可选命令",
"full_help": {
"message": [
"使用方法",
" help [cmd]",
"描述",
" 查看所有帮助信息或者cmd的详细帮助信息",
"使用举例",
" help",
" 打印全部帮助信息",
" help lists",
" 打印lists的详细帮助"
]
}
}
],
// 视情况 添加多语言支持
"hint_messages": [
// 提示信息
"软件版本: [%s]",
// 0
"未知错误: [%s]!",
// 1
"时间超出范围: %d!",
// 2
"订阅直播间[%s]成功!",
// 3
"用户[%s]的房间不存在!",
// 4
"直播间[%s]不存在!",
// 5
"取消订阅直播间[%s]成功!",
// 6
"直播间[%s]未订阅!",
// 7
"没有订阅任何直播间!",
// 8
"订阅的直播间列表:",
// 9
"没有找到[%s]命令的帮助!",
// 10
"参数错误!",
// 11
"取消订阅失败!",
// 12
"订阅失败!",
// 13
"订阅唤醒失败!",
// 14
"用户已经订阅了[%s]房间!",
// 15
"更新缓存成功!",
// 16
"更新缓存失败!",
// 17
"权限不足"
// 18
],
"broadcast_message": {
// Broadcast message
"live_start": [
// 开始直播事件
"用户 %s 直播中!",
"直播间: %s"
],
"live_end": [
// 直播结束
"用户 %s 直播结束了!"
]
}
}
},
"app": {
"number_of_threads": 2,
"enable_session": false,
"session_timeout": 0,
"session_same_site": "Null",
"session_cookie_key": "JSESSIONID",
"session_max_age": -1,
"document_root": "./",
"home_page": "index.html",
"use_implicit_page": true,
"implicit_page": "index.html",
"upload_path": "uploads",
"file_types": [
"gif",
"png",
"jpg",
"js",
"css",
"html",
"ico",
"swf",
"xap",
"apk",
"cur",
"xml",
"webp",
"svg"
],
"mime": {},
"locations": [
{
"default_content_type": "text/plain",
"alias": "",
"is_case_sensitive": false,
"allow_all": true,
"is_recursive": true,
"filters": []
}
],
"max_connections": 100000,
"max_connections_per_ip": 0,
"load_dynamic_views": false,
"dynamic_views_path": [
"./views"
],
"dynamic_views_output_path": "",
"json_parser_stack_limit": 1000,
"enable_unicode_escaping_in_json": true,
"float_precision_in_json": {
"precision": 0,
"precision_type": "significant"
},
"log": {
"use_spdlog": false,
"logfile_base_name": "",
"log_size_limit": 100000000,
"max_files": 0,
"log_level": "DEBUG",
"display_local_time": false
},
"run_as_daemon": false,
"handle_sig_term": true,
"relaunch_on_error": false,
"use_sendfile": true,
"use_gzip": true,
"use_brotli": false,
"static_files_cache_time": 5,
"idle_connection_timeout": 60,
"server_header_field": "",
"enable_server_header": true,
"enable_date_header": true,
"keepalive_requests": 0,
"pipelining_requests": 0,
"gzip_static": true,
"br_static": true,
"client_max_body_size": "1M",
"client_max_memory_body_size": "64K",
"client_max_websocket_message_size": "128K",
"reuse_port": false,
"enabled_compressed_request": false
}
}