-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathguoba.support.js
430 lines (429 loc) · 12.8 KB
/
guoba.support.js
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
import settings from './lib/settings.js';
import lodash from 'lodash';
import { resourcesPath } from './lib/path.js';
import path from 'path';
// 支持锅巴
export function supportGuoba() {
let allGroup = [];
Bot.gl.forEach((v, k) => {
allGroup.push({ label: `${v.group_name}(${k})`, value: k });
});
return {
pluginInfo: {
name: 'ZZZ-Plugin',
title: '绝区零插件',
author: '@别调P',
authorLink: 'https://github.com/bietiaop',
link: 'https://github.com/ZZZure/ZZZ-Plugin',
isV3: true,
isV2: false,
description: '提供绝区零相关查询功能',
icon: 'bi:box-seam',
iconColor: '#7ed99e',
iconPath: path.join(resourcesPath, 'common/images/logo.png'),
},
// 配置项信息
configInfo: {
// 配置项 schemas
schemas: [
{
component: 'Divider',
label: '通用设置',
},
{
field: 'config.render.scale',
label: '渲染精度',
bottomHelpMessage:
'设置插件的渲染精度,可选值50~200,建议100。设置高精度会提高图片的精细度,但因图片较大可能会影响渲染与发送速度',
component: 'InputNumber',
required: true,
componentProps: {
min: 50,
max: 200,
placeholder: '请输入数字',
},
},
{
field: 'config.url',
label: '绑定设备下载url',
bottomHelpMessage: '设置自定义的绑定绑定设备下载url',
component: 'Input',
componentProps: {
placeholder: '请输入绑定设备apk下载url',
},
},
{
field: 'config.query.others',
label: '查询他人信息',
bottomHelpMessage: '是否允许查询他人信息',
component: 'Switch',
},
{
field: 'config.update.autoCheck',
label: '更新推送',
bottomHelpMessage: '是否开启自动检查更新推送(仅检查,不更新)',
component: 'Switch',
},
{
field: 'config.update.cron',
label: '推送时间',
bottomHelpMessage: '设置自动检查更新推送的时间,cron表达式',
component: 'Input',
componentProps: {
placeholder: '请输入cron表达式',
},
},
{
field: 'config.mysCode',
label: '过🐎',
bottomHelpMessage:
'设置米游社接口返回的错误码,遇到这些错误码会触发过🐎',
component: 'Select',
componentProps: {
mode: 'multiple',
options: [
{ label: '1034', value: 1034 },
{ label: '10035', value: 10035 },
{ label: '10102', value: 10102 },
{ label: '10041', value: 10041 },
{ label: '5003', value: 5003 },
],
},
},
{
component: 'Divider',
label: '抽卡分析设置',
},
{
field: 'gacha.interval',
label: '冷却时间',
bottomHelpMessage:
'设置刷新抽卡记录的冷却时间,单位为秒,取值范围为0~1000',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 1000,
placeholder: '请输入数字',
},
},
{
field: 'gacha.allow_group',
label: '群聊链接刷新',
bottomHelpMessage: '是否允许群聊通过发送链接刷新抽卡记录',
component: 'Switch',
},
{
field: 'gacha.white_list',
label: '白名单群聊',
bottomHelpMessage: '在关闭群聊链接刷新时,允许通过链接刷新的群聊',
component: 'Select',
componentProps: {
mode: 'multiple',
options: allGroup,
},
},
{
field: 'gacha.black_list',
label: '黑名单群聊',
bottomHelpMessage: '在开启群聊链接刷新时,禁止通过链接刷新的群聊',
component: 'Select',
componentProps: {
mode: 'multiple',
options: allGroup,
},
},
// {
// component: 'Divider',
// label: '深渊设置',
// },
// {
// field: 'abyss.interval',
// label: '冷却时间',
// bottomHelpMessage:
// '设置刷新深渊信息的冷却时间,单位为秒,取值范围为0~1000',
// component: 'InputNumber',
// required: true,
// componentProps: {
// min: 0,
// max: 1000,
// placeholder: '请输入数字',
// },
// },
{
component: 'Divider',
label: '面板设置',
},
{
field: 'panel.interval',
label: '冷却时间',
bottomHelpMessage:
'设置刷新面板的冷却时间,单位为秒,取值范围为0~1000',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 1000,
placeholder: '请输入数字',
},
},
{
field: 'panel.roleInterval',
label: '冷却时间',
bottomHelpMessage:
'设置刷新角色的冷却时间,单位为秒,取值范围为0~1000',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 1000,
placeholder: '请输入数字',
},
},
{
component: 'Divider',
label: '攻略设置',
},
{
field: 'guide.default_guide',
label: '默认攻略',
bottomHelpMessage: '设置默认攻略,攻略合集即为多个攻略的合集',
component: 'Select',
required: true,
componentProps: {
options: [
{
value: 0,
label: '攻略合集',
},
{
value: 1,
label: '新艾利都快讯',
},
{
value: 2,
label: '清茶沐沐Kiyotya',
},
{
value: 3,
label: '小橙子阿',
},
{
value: 4,
label: '猫冬',
},
{
value: 5,
label: '月光中心',
},
{
value: 6,
label: '苦雪的清心花凉糕Suki',
},
{
value: 7,
label: 'HoYo青枫',
},
],
},
},
{
field: 'guide.max_forward_guides',
label: '合集最大数量',
bottomHelpMessage: '当查询攻略合集时,返回攻略的最大数量',
component: 'InputNumber',
required: true,
componentProps: {
min: 1,
max: 7,
placeholder: '请输入数字1~7',
},
},
{
component: 'Divider',
label:
'默认设备信息设置(通过"%设置默认设备"进行设置,如果不知道这是什么请勿修改)',
},
{
field: 'device.productName',
label: 'productName(deviceProduct)',
bottomHelpMessage: '设置默认设备productName字段',
component: 'Input',
componentProps: {
placeholder: '请输入productName',
},
},
{
field: 'device.productType',
label: 'productType(deviceName)',
bottomHelpMessage: '设置默认设备productType字段',
component: 'Input',
componentProps: {
placeholder: '请输入productType',
},
},
{
field: 'device.modelName',
label: 'modelName(deviceModel)',
bottomHelpMessage: '设置默认设备modelName字段',
component: 'Input',
componentProps: {
placeholder: '请输入modelName',
},
},
{
field: 'device.osVersion',
label: 'osVersion(androidVersion)',
bottomHelpMessage: '设置默认设备osVersion字段',
component: 'Input',
componentProps: {
placeholder: '请输入osVersion',
},
},
{
field: 'device.deviceInfo',
label: 'deviceInfo(deviceFingerprint)',
bottomHelpMessage: '设置默认设备deviceInfo字段',
component: 'Input',
componentProps: {
placeholder: '请输入deviceInfo',
},
},
{
field: 'device.board',
label: 'board(deviceBoard)',
bottomHelpMessage: '设置默认设备board字段',
component: 'Input',
componentProps: {
placeholder: '请输入board',
},
},
{
component: 'Divider',
label: '优先级设置(-1000~1000)',
},
{
field: 'priority.card',
label: '卡片查询',
bottomHelpMessage: '设置玩家信息卡片查询指令优先级',
component: 'InputNumber',
required: true,
componentProps: {
min: -1000,
max: 1000,
placeholder: '请输入数字',
},
},
{
field: 'priority.abyss',
label: '深渊查询',
bottomHelpMessage: '设置深渊查询指令优先级',
component: 'InputNumber',
required: true,
componentProps: {
min: -1000,
max: 1000,
placeholder: '请输入数字',
},
},
{
field: 'priority.gachalog',
label: '抽卡记录查询',
bottomHelpMessage: '设置抽卡记录查询指令优先级',
component: 'InputNumber',
required: true,
componentProps: {
min: -1000,
max: 1000,
placeholder: '请输入数字',
},
},
{
field: 'priority.guide',
label: '攻略查询',
bottomHelpMessage: '设置攻略查询指令优先级',
component: 'InputNumber',
required: true,
componentProps: {
min: -1000,
max: 1000,
placeholder: '请输入数字',
},
},
{
field: 'priority.help',
label: '帮助查询',
bottomHelpMessage: '设置帮助指令优先级',
component: 'InputNumber',
required: true,
componentProps: {
min: -1000,
max: 1000,
placeholder: '请输入数字',
},
},
{
field: 'priority.manage',
label: '管理',
bottomHelpMessage: '设置管理指令优先级',
component: 'InputNumber',
required: true,
componentProps: {
min: -1000,
max: 1000,
placeholder: '请输入数字',
},
},
{
field: 'priority.note',
label: '体力查询',
bottomHelpMessage: '设置体力查询指令优先级',
component: 'InputNumber',
required: true,
componentProps: {
min: -1000,
max: 1000,
placeholder: '请输入数字',
},
},
{
field: 'priority.panel',
label: '面板查询',
bottomHelpMessage: '设置面板查询指令优先级',
component: 'InputNumber',
required: true,
componentProps: {
min: -1000,
max: 1000,
placeholder: '请输入数字',
},
},
{
field: 'priority.update',
label: '更新插件',
bottomHelpMessage: '设置更新插件指令优先级',
component: 'InputNumber',
required: true,
componentProps: {
min: -1000,
max: 1000,
placeholder: '请输入数字',
},
},
],
getConfigData() {
return settings.merge();
},
// 设置配置的方法(前端点确定后调用的方法)
setConfigData(data, { Result }) {
let config = {};
for (let [keyPath, value] of Object.entries(data)) {
lodash.set(config, keyPath, value);
}
config = lodash.merge({}, settings.merge, config);
settings.analysis(config);
return Result.ok({}, '保存成功~');
},
},
};
}