-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathguoba.support.js
224 lines (223 loc) · 6.26 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
import setting from './utils/setting.js'
import lodash from 'lodash'
import { pluginResources } from './utils/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: 'StarRail-plugin',
title: '星穹铁道插件',
author: '@鹤望兰',
authorLink: 'https://gitee.com/hewang1an',
link: 'https://gitee.com/hewang1an/StarRail-plugin',
isV3: true,
isV2: false,
description: '提供崩坏星穹铁道相关查询功能',
icon: 'bi:box-seam',
iconColor: '#7ed99e',
iconPath: path.join(pluginResources, 'common/cont/pamu.png')
},
// 配置项信息
configInfo: {
// 配置项 schemas
schemas: [{
component: 'Divider',
label: '通用设置'
},
{
field: 'gachaHelp.noteFlag',
label: '体力',
bottomHelpMessage: '是否使用本插件的体力模板',
component: 'Switch'
},
{
field: 'gachaHelp.renderScale',
label: '渲染精度',
bottomHelpMessage: '设置插件的渲染精度,可选值50~200,建议100。设置高精度会提高图片的精细度,但因图片较大可能会影响渲染与发送速度',
component: 'InputNumber',
required: true,
componentProps: {
min: 50,
max: 200,
placeholder: '请输入数字'
}
},
{
field: 'gachaHelp.gatchaUrlGroup',
label: '抽卡链接群聊绑定',
bottomHelpMessage: '是否允许在群内绑定抽卡链接',
component: 'Switch'
},
{
field: 'gachaHelp.abbrSetAuth',
label: '角色别名管理权限',
bottomHelpMessage: '# 别名设置权限 0-所有群员都可以添加 1-群管理员才能添加 2-主人才能添加',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 2,
placeholder: '请输入0-2数字'
}
},
{
component: 'Divider',
label: '帮助设置'
},
{
field: 'gachaHelp.docs',
label: '星铁抽卡教程链接',
bottomHelpMessage: '发送出来的教程链接',
component: 'Input',
required: true,
componentProps: {
placeholder: '请输入链接'
}
},
{
field: 'cookieHelp.docs',
label: 'Cookie帮助',
bottomHelpMessage: '发送出来的Cookie帮助',
component: 'Input',
required: true,
componentProps: {
placeholder: 'Cookie帮助'
}
},
{
component: 'Divider',
label: '面板设置'
},
{
field: 'PanelSetting.no_profile',
label: '禁用群号',
bottomHelpMessage: '禁用第三方面板图功能的群',
component: 'Select',
componentProps: {
allowAdd: true,
allowDel: true,
mode: 'multiple',
options: allGroup
}
},
{
field: 'PanelSetting.originalPic',
label: '面板原图',
bottomHelpMessage: '是否开启面板原图开关',
component: 'Switch'
},
{
field: 'PanelSetting.backCalloriginalPic',
label: '原图撤回',
bottomHelpMessage: '是否开启原图撤回开关',
component: 'Switch'
},
{
field: 'PanelSetting.backCalloriginalPicTime',
label: '撤回时间',
bottomHelpMessage: '原图撤回时间',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 10000,
placeholder: '请输入数字',
addonAfter: '秒'
}
},
{
component: 'Divider',
label: '抽卡设置'
},
{
field: 'gccfg.limit.group',
label: '群聊抽卡',
bottomHelpMessage: '是否允许群聊抽卡',
component: 'Switch'
},
{
field: 'gccfg.limit.private',
label: '私聊抽卡',
bottomHelpMessage: '是否允许私聊抽卡',
component: 'Switch'
},
{
field: 'gccfg.limit.count',
label: '抽卡次数',
bottomHelpMessage: '限制抽卡次数,0为无限制',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 10000,
placeholder: '请输入数量',
addonAfter: '次'
}
},
{
field: 'gccfg.recall.enable',
label: '自动撤回',
bottomHelpMessage: '是否自动撤回无五星的消息',
component: 'Switch'
},
{
field: 'gccfg.recall.time',
label: '撤回时间',
bottomHelpMessage: '自动撤回无五星消息的时间',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 10000,
placeholder: '请输入数字',
addonAfter: '秒'
}
},
{
field: 'gccfg.disable_group',
label: '禁用群号',
bottomHelpMessage: '禁用抽卡功能的群',
component: 'Select',
componentProps: {
allowAdd: true,
allowDel: true,
mode: 'multiple',
options: allGroup
}
},
{
component: 'Divider',
label: '攻略设置'
},
{
field: 'mys.defaultSource',
label: '攻略图默认来源',
bottomHelpMessage: '米游社攻略图默认来源设置',
component: 'InputNumber',
required: true,
componentProps: {
min: 1,
max: 6,
placeholder: '请输入数字'
}
}
],
getConfigData () {
return setting.merge()
},
// 设置配置的方法(前端点确定后调用的方法)
setConfigData (data, { Result }) {
let config = {}
for (let [keyPath, value] of Object.entries(data)) {
lodash.set(config, keyPath, value)
}
config = lodash.merge({}, setting.merge, config)
setting.analysis(config)
return Result.ok({}, '保存成功~')
}
}
}
}