-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathguoba.support.js
More file actions
209 lines (208 loc) · 8.87 KB
/
guoba.support.js
File metadata and controls
209 lines (208 loc) · 8.87 KB
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
import Config from './components/Config.js'
// 支持锅巴
export function supportGuoba() {
return {
// 插件信息,将会显示在前端页面
// 如果你的插件没有在插件库里,那么需要填上补充信息
// 如果存在的话,那么填不填就无所谓了,填了就以你的信息为准
pluginInfo: {
name: 'riz-plugin',
title: 'Riz-Plugin',
author: '@Catrong',
authorLink: 'https://github.com/Catrong',
link: 'https://gitee.com/Catrong/riz-plugin',
isV3: true,
isV2: false,
description: 'Rizline 查分及娱乐插件',
// 显示图标,此为个性化配置
// 图标可在 https://icon-sets.iconify.design 这里进行搜索
icon: 'icon-park-solid:pigeon',
// 图标颜色,例:#FF0000 或 rgb(255, 0, 0)
iconColor: '#000'
},
// 配置项信息
configInfo: {
// 配置项 schemas
schemas: [
{
label: '渲染设置',
component: 'SOFT_GROUP_BEGIN'
},
{
field: 'renderScale',
label: '渲染精度',
bottomHelpMessage: '对所有的图片生效,设置渲染精度',
component: 'InputNumber',
required: true,
componentProps: {
min: 50,
max: 200,
placeholder: '请输入渲染精度',
addonAfter: "%"
},
},
{
field: 'randerQuality',
label: '渲染质量',
bottomHelpMessage: '对所有的图片生效,设置渲染的质量',
component: 'InputNumber',
required: true,
componentProps: {
min: 1,
max: 100,
placeholder: '请输入渲染质量',
addonAfter: "%"
},
},
{
field: 'timeout',
label: '渲染超时时间',
bottomHelpMessage: '对所有的图片生效,超时后重启puppeteer,单位ms',
component: 'InputNumber',
required: true,
componentProps: {
min: 1000,
max: 120000,
placeholder: '请输入渲染超时时间',
addonAfter: "ms"
},
},
{
field: 'waitingTimeout',
label: '等待超时时间',
bottomHelpMessage: '对所有的图片生效,单位ms',
component: 'InputNumber',
required: true,
componentProps: {
min: 1000,
max: 120000,
placeholder: '请输入等待超时时间',
addonAfter: "ms"
},
},
{
field: 'renderNum',
label: '并行渲染数量',
bottomHelpMessage: '并行数量越多,占用的资源越多,建议谨慎修改,修改后重启生效',
component: 'InputNumber',
required: true,
componentProps: {
min: 1,
max: 10,
placeholder: '请输入并行渲染数量',
},
},
{
label: '',
component: 'Divider'
},
{
field: 'onLinePhiIllUrl',
label: '在线曲绘来源',
bottomHelpMessage: '仅在未下载曲绘时有效,不影响下载曲绘指令。在线曲绘将重复下载曲绘资源,建议使用 /下载曲绘 将曲绘缓存到本地',
component: "RadioGroup",
componentProps: {
buttonStyle: "solid",
optionType: "button",
options: [
{
label: 'github',
value: "https://github.com/Catrong/riz-plugin-ill/blob/main"
},
{
label: 'github代理(gh-proxy)',
value: "https://gh-proxy.org/https://raw.githubusercontent.com/Catrong/riz-plugin-ill/refs/heads/main"
},
{
label: 'github代理(gitproxy.click)',
value: "https://gitproxy.click/https://raw.githubusercontent.com/Catrong/riz-plugin-ill/refs/heads/main"
}
]
}
},
{
field: 'downIllUrl',
label: '下载曲绘源',
bottomHelpMessage: '下载曲绘的源,实时生效',
component: "RadioGroup",
componentProps: {
buttonStyle: "solid",
optionType: "button",
options: [
{
label: 'github',
value: "https://github.com/Catrong/riz-plugin-ill.git"
},
{
label: 'github代理(gh-proxy)',
value: "https://gh-proxy.com/https://github.com/Catrong/riz-plugin-ill.git"
},
{
label: 'github代理(gitproxy.click)',
value: "https://gitproxy.click/https://github.com/Catrong/riz-plugin-ill.git"
}
]
}
},
{
field: 'watchInfoPath',
label: '监听信息文件',
bottomHelpMessage: '是否监听信息文件变化,如果机器人有自动更新插件功能建议开启,如遇监听文件数量超限请尝试关闭',
component: 'Switch',
},
{
field: 'cmdhead',
label: '命令头',
bottomHelpMessage: '命令正则匹配开头,不包含#/,支持正则表达式,\'\\\' 请双写( \\s --> \\\\s ),最外层可以不加括号',
component: 'Input',
required: false,
componentProps: {
placeholder: '请输入命令头',
},
},
{
field: 'mutiNickWaitTimeOut',
label: '多个曲目回复序号等待时长',
bottomHelpMessage: '别名重复触发多个曲目选择时,等待回复序号的时长,单位:秒',
component: 'InputNumber',
required: true,
componentProps: {
min: 5,
max: 999,
placeholder: '请输入等待时长',
},
},
],
// 获取配置数据方法(用于前端填充显示数据)
getConfigData() {
const defset = Config.getdefSet('config')
/**@type {Record<configName, any> | {}} */
let config = {}
for (var i in defset) {
config[i] = Config.getUserCfg('config', i)
}
return config
},
// 设置配置的方法(前端点确定后调用的方法)
setConfigData(data, { Result }) {
if (data.isGuild) {
data.WordB19Img = false
data.WordSuggImg = false
}
var vis = false
// if (data.VikaToken && data.VikaToken.length != 23) {
// data.VikaToken = ''
// vis = true
// }
for (let [keyPath, value] of Object.entries(data)) {
Config.modify('config', keyPath, value)
}
// if (vis) {
// return Result.ok({}, 'VikaToken非法')
// } else {
return Result.ok({}, '保存成功~')
// }
},
},
}
}