koishi-plugin-jryspro-fast 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +228 -0
- package/README.md +61 -0
- package/lib/index.d.ts +49 -0
- package/lib/index.js +414 -0
- package/package.json +60 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
该项目遵循 [语义化版本](http://semver.org) 指南。
|
|
4
|
+
|
|
5
|
+
## v1.0.0
|
|
6
|
+
|
|
7
|
+
* 写好了第一版,发布了插件
|
|
8
|
+
|
|
9
|
+
## v1.0.1
|
|
10
|
+
|
|
11
|
+
### 修改
|
|
12
|
+
|
|
13
|
+
* 修改了README
|
|
14
|
+
|
|
15
|
+
## v1.0.2
|
|
16
|
+
|
|
17
|
+
### 新增
|
|
18
|
+
|
|
19
|
+
* 新增等待提示
|
|
20
|
+
|
|
21
|
+
### 修改
|
|
22
|
+
|
|
23
|
+
* 将“您”改成群名/用户昵称
|
|
24
|
+
* 修改必备插件为puppeteer,database为可选。没有puppeteer渲染不了图片,没有database不能限制调用时间。
|
|
25
|
+
|
|
26
|
+
## v1.0.3
|
|
27
|
+
|
|
28
|
+
### 修改
|
|
29
|
+
|
|
30
|
+
* 修改版本兼容,从v4.11.0往上开始兼容
|
|
31
|
+
|
|
32
|
+
## v1.0.4
|
|
33
|
+
|
|
34
|
+
### 新增
|
|
35
|
+
|
|
36
|
+
* 新增图文模式,但是图文模式只能使用我的api,如果有需要可以自己copy源码自行修改,进行二次开发(这一版代码写的有点shi, 见谅)
|
|
37
|
+
|
|
38
|
+
## v1.0.5
|
|
39
|
+
|
|
40
|
+
### 新增
|
|
41
|
+
|
|
42
|
+
* 新增callme昵称支持
|
|
43
|
+
|
|
44
|
+
## v1.0.6
|
|
45
|
+
|
|
46
|
+
### 新增
|
|
47
|
+
|
|
48
|
+
* 现在可以修改图文模式的图片api了,但跟渲染图一样只能使用返回图片的api。
|
|
49
|
+
|
|
50
|
+
> 需要注意的是,api后我加了个v的参数作为时间戳来刷新图片如果您的api有跟v参数冲突的建议换一个api或者二次开发本插件
|
|
51
|
+
|
|
52
|
+
## v1.1.0
|
|
53
|
+
|
|
54
|
+
### 新增
|
|
55
|
+
|
|
56
|
+
* 新增 `fortuneApi` 配置
|
|
57
|
+
|
|
58
|
+
### 调整
|
|
59
|
+
|
|
60
|
+
* 后端api寄了,现在可以配置运势源的api,如果我的也寄掉了那么请换成你自建的后端或者用别人的后端
|
|
61
|
+
|
|
62
|
+
> 运势源api仓库[https://github.com/Twiyin0/jryspro-api](https://github.com/Twiyin0/jryspro-api)
|
|
63
|
+
|
|
64
|
+
## v1.1.1
|
|
65
|
+
|
|
66
|
+
### 修复
|
|
67
|
+
|
|
68
|
+
* 修改了README
|
|
69
|
+
* 不小心把csv文件上传了导致包很大
|
|
70
|
+
* 就是删了点有的没的
|
|
71
|
+
|
|
72
|
+
## v1.2.0
|
|
73
|
+
|
|
74
|
+
### 修复
|
|
75
|
+
|
|
76
|
+
* 据反映大部分用户无法正常请求api,看了下原因是request已弃用,因此导致的问题
|
|
77
|
+
|
|
78
|
+
### 修改
|
|
79
|
+
|
|
80
|
+
* 将request替换成内置的axios
|
|
81
|
+
|
|
82
|
+
## v1.2.1
|
|
83
|
+
|
|
84
|
+
### 更新
|
|
85
|
+
|
|
86
|
+
* 更新了有的没的
|
|
87
|
+
|
|
88
|
+
## v1.3.0
|
|
89
|
+
|
|
90
|
+
### 此版本改了配置文件,请更新时停止该插件并删除该插件在配置文件中的配置项!!
|
|
91
|
+
|
|
92
|
+
### 更新
|
|
93
|
+
|
|
94
|
+
* 运势改为文件,无需再使用运势api
|
|
95
|
+
* imgApi与subimgApi支持本地文件夹绝对路径,就是说可以随机自己文件夹内的图片了
|
|
96
|
+
* 7月16后,本人的图源api不再向外提供,请更换为自己的图源api或文件夹绝对路径
|
|
97
|
+
* 自建的运势api和图源api旧版本仍可以使用
|
|
98
|
+
|
|
99
|
+
## v1.3.2
|
|
100
|
+
|
|
101
|
+
### 新增(更新本插件前请务必关闭本插件)
|
|
102
|
+
### 此版本改了配置文件,请更新时停止该插件并删除该插件在配置文件中的配置项!!
|
|
103
|
+
|
|
104
|
+
* 增加了启用/禁用自动夜间模式开关
|
|
105
|
+
|
|
106
|
+
## v1.3.3
|
|
107
|
+
|
|
108
|
+
### 修复
|
|
109
|
+
|
|
110
|
+
* 修复图片缓存不清空的问题(注意:只针对?random有效参数)
|
|
111
|
+
* 如果你的api地址后不支持?random请不要更新此插件
|
|
112
|
+
|
|
113
|
+
## v1.3.4
|
|
114
|
+
|
|
115
|
+
### 优化
|
|
116
|
+
* 优化图片缓存刷新
|
|
117
|
+
* 刷新图片缓存方法:api中 #e# 代表当前unix时间戳
|
|
118
|
+
|
|
119
|
+
## v1.3.5
|
|
120
|
+
|
|
121
|
+
### 优化
|
|
122
|
+
* 获取不到用户id时提示
|
|
123
|
+
* 部分session.send替换成return
|
|
124
|
+
|
|
125
|
+
## v1.3.6
|
|
126
|
+
### 修改
|
|
127
|
+
* !改为==0
|
|
128
|
+
* 起猛了,发太快了
|
|
129
|
+
|
|
130
|
+
## v1.3.7
|
|
131
|
+
### 修复
|
|
132
|
+
* 修复jrys无法在沙盒中运行
|
|
133
|
+
* 当无法获取用户id时采用用户名作为今日运势的依据
|
|
134
|
+
|
|
135
|
+
## v1.3.8
|
|
136
|
+
### 适配
|
|
137
|
+
* 适配了一下新版本
|
|
138
|
+
|
|
139
|
+
## v1.3.10
|
|
140
|
+
### 修复
|
|
141
|
+
* 修复了Digest无法更新的问题
|
|
142
|
+
|
|
143
|
+
## v1.3.11
|
|
144
|
+
### 修复
|
|
145
|
+
* 修复了uid无法获取时发生未知错误
|
|
146
|
+
|
|
147
|
+
## v1.3.12
|
|
148
|
+
### 修复
|
|
149
|
+
* 修复了运势有概率不会变化的问题(由于某些原因会有概率无法获取用户UID,目前用固定数值的方法产生运势数组)
|
|
150
|
+
|
|
151
|
+
## v1.3.13
|
|
152
|
+
### 修复
|
|
153
|
+
* 加法换成乘法,这样能保证每次的数值不一样
|
|
154
|
+
|
|
155
|
+
## v1.3.14
|
|
156
|
+
### 修复
|
|
157
|
+
* 运势取模不再+1,避免溢出数组
|
|
158
|
+
|
|
159
|
+
## v1.3.15
|
|
160
|
+
### 修复
|
|
161
|
+
* 获取时间戳改为var,const可能会导致时间戳不变化导致运势不变化
|
|
162
|
+
|
|
163
|
+
## v2.0.0
|
|
164
|
+
## UI修改
|
|
165
|
+
* 修改了默认模式2,为新版竖屏模式,同时-N(大写)也可以输出新版jrys
|
|
166
|
+
## 说明
|
|
167
|
+
* 背景图采用竖屏imgurl
|
|
168
|
+
* subimgurl改为可选,不用配置subimgApi也能用jryspro-fast了
|
|
169
|
+
|
|
170
|
+
## v2.0.2
|
|
171
|
+
## 修复
|
|
172
|
+
* 修复了使用.evaluate()函数超时的问题,但是源码内注释保留,为今后做UI渲染提供思路()
|
|
173
|
+
|
|
174
|
+
## 修改
|
|
175
|
+
* 修改了一点小细节
|
|
176
|
+
* 注:头像获取不到可能是适配器问题,采用koishi官方API ———— session.author.avatar 来获取的头像
|
|
177
|
+
|
|
178
|
+
## v2.1.0
|
|
179
|
+
## 修复
|
|
180
|
+
* 修复了qq适配器无法显示头像的问题
|
|
181
|
+
* 修复了直接启用插件会报未知错误
|
|
182
|
+
* 修复jrys -i无法使用的问题
|
|
183
|
+
|
|
184
|
+
## 新增
|
|
185
|
+
* 如果使用qq适配器请配置adapterqqID配置项
|
|
186
|
+
|
|
187
|
+
## v2.1.3
|
|
188
|
+
## 修复
|
|
189
|
+
* 彻底修复截图超时问题
|
|
190
|
+
|
|
191
|
+
## v2.1.4
|
|
192
|
+
## 修复
|
|
193
|
+
* 修复CDN超时的问题
|
|
194
|
+
|
|
195
|
+
## v2.1.6
|
|
196
|
+
## 修复
|
|
197
|
+
* 修复截图超时的问题
|
|
198
|
+
* QQ适配器不需要再配置botid
|
|
199
|
+
|
|
200
|
+
## v2.1.8
|
|
201
|
+
## 新增
|
|
202
|
+
* 新版渲染支持夜间模式,夜间模式回归啦
|
|
203
|
+
* 新增了npmignore,将index.html隐藏防止api泄露
|
|
204
|
+
|
|
205
|
+
## v2.1.9
|
|
206
|
+
### 更新
|
|
207
|
+
* 更新了版本号(bushi)
|
|
208
|
+
|
|
209
|
+
### 修复
|
|
210
|
+
* 修复渲染图片完成后报错的问题
|
|
211
|
+
|
|
212
|
+
## v2.1.10
|
|
213
|
+
### 更新
|
|
214
|
+
* 更新了版本号(bushi)
|
|
215
|
+
|
|
216
|
+
### 修复
|
|
217
|
+
* 上个版本js文件夹没有上传成功
|
|
218
|
+
|
|
219
|
+
## v2.1.12 (此版本有新增配置项)
|
|
220
|
+
### 新增
|
|
221
|
+
* 新增图片输出质量配置项,之前渲染图输出的图片都太大了
|
|
222
|
+
* 图片输出质量拉到顶时输出png格式,无损
|
|
223
|
+
|
|
224
|
+
## v2.2.0
|
|
225
|
+
|
|
226
|
+
### 修改
|
|
227
|
+
|
|
228
|
+
* 修改必备插件为vercelSatoriPngService。没有vercelSatoriPngService渲染不了图片。
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# koishi-plugin-jryspro-fast
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/koishi-plugin-jryspro-fast)
|
|
4
|
+
|
|
5
|
+
jrys plugin for bella
|
|
6
|
+
## 注意
|
|
7
|
+
* 更新前请看[更新日志](https://raw.githubusercontent.com/pgnqukezrdxmhjso/koishi-plugin-jryspro-fast/main/CHANGELOG.md),也许有些版本你并不需要更新
|
|
8
|
+
* 如果需要将v1.2.x更新到v1.3.x请先停止本插件再更新,以免koishi炸掉
|
|
9
|
+
* v1.3.3(非重要更新) 如果你的图源api地址不支持?random参数,请不要更新此插件
|
|
10
|
+
|
|
11
|
+
## 使用方法
|
|
12
|
+
指令: 今日运势
|
|
13
|
+
指令别名: jrys
|
|
14
|
+
可选选项:
|
|
15
|
+
* -o 纯文本输出,可以提高输出速率
|
|
16
|
+
* -n 无视夜间模式输出,可能有群友不太喜欢夜间模式的
|
|
17
|
+
* -t 输出图文,有群友想存图的
|
|
18
|
+
* -i 渲染图模式输出,这个是默认的
|
|
19
|
+
|
|
20
|
+
> 如果你无法使用此插件,请检查
|
|
21
|
+
> - 1. (使用命令时无反应,报错等)请检查指令是否有冲突或者是否正确安装vercelSatoriPngService
|
|
22
|
+
> - 2. 提示“发生未知错误”可能是没有获取到群友的uid,需要在数据库内刷新一下
|
|
23
|
+
> - 3. “数据出错”之类的提示不是本插件的提示,可能你装了其他插件
|
|
24
|
+
> - 4. 启用不了插件。请检查koishi版本,vercelSatoriPngService版本等是否再兼容范围内,或重启koishi,删除此插件依赖再尝试重装
|
|
25
|
+
|
|
26
|
+
随机文件夹内图片时请注意路径\`C:user/path/to/\`不要把后面的/忘了
|
|
27
|
+
|
|
28
|
+
## 配置
|
|
29
|
+
| 配置项 | 参数 | 描述 |
|
|
30
|
+
|---------------|-----|---------------------------------------------------------------------------------------------------------|
|
|
31
|
+
| `interval` | | 指令调用间隔,得加载数据库才能使用调用间隔,单位是毫秒(ms) |
|
|
32
|
+
| `nightauto` | | 是否开启自动夜间模式 |
|
|
33
|
+
| `nightStart` | | 夜间模式开启时间整点(24时制),一般设置在晚上 |
|
|
34
|
+
| `nightEnd` | | 夜间模式结束时间整点(24时制),一般设置在早上(需要注意的是,结束时间要小于开启时间,否则启用默认值) |
|
|
35
|
+
| `imgApi` |(v1.3.0可用本地文件夹绝对路径)| 图片api地址,仅支持返回图片的api,不支持json等。由于我只制作了竖屏图片适配,建议使用竖屏的图片。在填写时不要把`http(s)://`忘了哦。 |
|
|
36
|
+
| `waitting` | | 是否开启等待提示,默认开启 |
|
|
37
|
+
| `defaultMode` | | 默认输出模式,非以下参数默认为`0` |
|
|
38
|
+
| | `0` | 渲染输出-vercelSatoriPngService渲染输出 |
|
|
39
|
+
| | `1` | 纯文本输出,仅输出文本 |
|
|
40
|
+
| | `2` | (默认)新版竖屏模式输出 |
|
|
41
|
+
| | `3` | 图文输出,文字+图片的输出方式 |
|
|
42
|
+
| `subimgApi` |(v1.3.0可用本地文件夹绝对路径)| 图文模式的图片api地址,仅支持返回图片的api,不支持json等。api后我加了?v=的参数用来刷新图片,如果你的api跟v这个参数冲突了可以换一个api或者。在填写时不要把`http(s)://`忘了哦 |
|
|
43
|
+
| `fortuneApi` |(v1.3.0前可用)| 运势源api,尽可能用自己的api(我服务器也不是永久的,也可能被打死如果没了你可以选择自建后端然后用自己的api) |
|
|
44
|
+
|
|
45
|
+
# CHANGELOG
|
|
46
|
+
|
|
47
|
+
[更新日志](https://raw.githubusercontent.com/pgnqukezrdxmhjso/koishi-plugin-jryspro-fast/main/CHANGELOG.md)
|
|
48
|
+
* 注:`v2.1.11` 版本有新增配置项
|
|
49
|
+
|
|
50
|
+
## api说明
|
|
51
|
+
* api url以 #e# 结尾可以在末尾添加更新时间戳(例子后面等价的数字为当前时间戳)
|
|
52
|
+
* 例: https://api.example.com/img?#e# ==等价于== https://api.example.com/img?271878
|
|
53
|
+
* 例: https://api.example.com/img?type=acc&v=#e# ==等价于== https://api.example.com/img?type=acc&v=271878
|
|
54
|
+
|
|
55
|
+
本人的图源api不再向外提供,可以选择随机指定文件夹内的图片。或者其他图源的api(推荐竖屏)
|
|
56
|
+
imgApi与subimgApi支持本地文件夹绝对路径和http(s)等网络api
|
|
57
|
+
|
|
58
|
+
# TIP
|
|
59
|
+
如果没有图片输出可以看看log时不时vercelSatoriPngService有问题
|
|
60
|
+
确定vercelSatoriPngService没问题那就是api寄了或者本地路径没填对,别把最后面的/省了
|
|
61
|
+
有问题就github开issues吧
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Context, Schema } from "koishi";
|
|
2
|
+
export declare const name = "jryspro-fast";
|
|
3
|
+
export declare const usage = "\n## \u66F4\u65B0\u63D2\u4EF6\u524D\u8BF7\u505C\u6B62\u8FD0\u884C\u63D2\u4EF6\n\u63D2\u4EF6\u914D\u7F6E\u9879\u53EF\u80FD\u4F1A\u6709\u6539\u52A8\uFF0C\u4E0D\u505C\u6B62\u63D2\u4EF6\u76F4\u63A5\u66F4\u65B0\u53EF\u80FD\u4F1A\u5BFC\u81F4koishi\u70B8\u6389\n\n## \u4F7F\u7528\u8BF4\u660E\n\n> \u5982\u679C\u4F60\u65E0\u6CD5\u4F7F\u7528\u6B64\u63D2\u4EF6\uFF0C\u8BF7\u68C0\u67E5\n> - 1. (\u4F7F\u7528\u547D\u4EE4\u65F6\u65E0\u53CD\u5E94\uFF0C\u62A5\u9519\u7B49)\u8BF7\u68C0\u67E5\u6307\u4EE4\u662F\u5426\u6709\u51B2\u7A81\u6216\u8005\u662F\u5426\u6B63\u786E\u5B89\u88C5vercelSatoriPngService\n> - 2. \u63D0\u793A\u201C\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u201D\u53EF\u80FD\u662F\u6CA1\u6709\u83B7\u53D6\u5230\u7FA4\u53CB\u7684uid\uFF0C\u9700\u8981\u5728\u6570\u636E\u5E93\u5185\u5237\u65B0\u4E00\u4E0B\n> - 3. \u201C\u6570\u636E\u51FA\u9519\u201D\u4E4B\u7C7B\u7684\u63D0\u793A\u4E0D\u662F\u672C\u63D2\u4EF6\u7684\u63D0\u793A\uFF0C\u53EF\u80FD\u4F60\u88C5\u4E86\u5176\u4ED6\u63D2\u4EF6\n> - 4. \u542F\u7528\u4E0D\u4E86\u63D2\u4EF6\u3002\u8BF7\u68C0\u67E5koishi\u7248\u672C\uFF0CvercelSatoriPngService\u7248\u672C\u7B49\u662F\u5426\u518D\u517C\u5BB9\u8303\u56F4\u5185\uFF0C\u6216\u91CD\u542Fkoishi\uFF0C\u5220\u9664\u6B64\u63D2\u4EF6\u4F9D\u8D56\u518D\u5C1D\u8BD5\u91CD\u88C5\n\n\u968F\u673A\u6587\u4EF6\u5939\u5185\u56FE\u7247\u65F6\u8BF7\u6CE8\u610F\u8DEF\u5F84`C:/user/path/to/`\u4E0D\u8981\u628A\u540E\u9762\u7684/\u5FD8\u4E86\n\n## api\u8BF4\u660E\n* api url\u4EE5 #e# \u7ED3\u5C3E\u53EF\u4EE5\u5728\u672B\u5C3E\u6DFB\u52A0\u66F4\u65B0\u65F6\u95F4\u6233(\u4F8B\u5B50\u540E\u9762\u7B49\u4EF7\u7684\u6570\u5B57\u4E3A\u5F53\u524D\u65F6\u95F4\u6233)\n* \u4F8B: https://api.example.com/img?#e# ==\u7B49\u4EF7\u4E8E== https://api.example.com/img?271878\n* \u4F8B: https://api.example.com/img?type=acc&v=#e# ==\u7B49\u4EF7\u4E8E== https://api.example.com/img?type=acc&v=271878\n\nimgApi\u4E0EsubimgApi\u652F\u6301\u672C\u5730\u6587\u4EF6\u5939\u7EDD\u5BF9\u8DEF\u5F84\u548Chttp(s)\u7B49\u7F51\u7EDCapi\n";
|
|
4
|
+
export interface Config {
|
|
5
|
+
interval: number;
|
|
6
|
+
nightauto: boolean;
|
|
7
|
+
nightStart: number;
|
|
8
|
+
nightEnd: number;
|
|
9
|
+
imgApi: string;
|
|
10
|
+
imgQuality: number;
|
|
11
|
+
waiting: boolean;
|
|
12
|
+
callme: boolean;
|
|
13
|
+
defaultMode: number;
|
|
14
|
+
subimgApi: string;
|
|
15
|
+
avatarUrl: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const schema: Schema<Schemastery.ObjectS<{
|
|
18
|
+
interval: Schema<number, number>;
|
|
19
|
+
nightauto: Schema<boolean, boolean>;
|
|
20
|
+
nightStart: Schema<number, number>;
|
|
21
|
+
nightEnd: Schema<number, number>;
|
|
22
|
+
imgApi: Schema<string, string>;
|
|
23
|
+
imgQuality: Schema<number, number>;
|
|
24
|
+
waiting: Schema<boolean, boolean>;
|
|
25
|
+
callme: Schema<boolean, boolean>;
|
|
26
|
+
defaultMode: Schema<0 | 1 | 2 | 3, 0 | 1 | 2 | 3>;
|
|
27
|
+
subimgApi: Schema<string, string>;
|
|
28
|
+
avatarUrl: Schema<string, string>;
|
|
29
|
+
}>, Schemastery.ObjectT<{
|
|
30
|
+
interval: Schema<number, number>;
|
|
31
|
+
nightauto: Schema<boolean, boolean>;
|
|
32
|
+
nightStart: Schema<number, number>;
|
|
33
|
+
nightEnd: Schema<number, number>;
|
|
34
|
+
imgApi: Schema<string, string>;
|
|
35
|
+
imgQuality: Schema<number, number>;
|
|
36
|
+
waiting: Schema<boolean, boolean>;
|
|
37
|
+
callme: Schema<boolean, boolean>;
|
|
38
|
+
defaultMode: Schema<0 | 1 | 2 | 3, 0 | 1 | 2 | 3>;
|
|
39
|
+
subimgApi: Schema<string, string>;
|
|
40
|
+
avatarUrl: Schema<string, string>;
|
|
41
|
+
}>>;
|
|
42
|
+
export declare const inject: string[];
|
|
43
|
+
export interface JrysItem {
|
|
44
|
+
fortuneSummary: string;
|
|
45
|
+
luckyStar: string;
|
|
46
|
+
signText: string;
|
|
47
|
+
unsignText: string;
|
|
48
|
+
}
|
|
49
|
+
export declare function apply(ctx: Context, config: Config): void;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name2 in all)
|
|
10
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
apply: () => apply,
|
|
34
|
+
inject: () => inject,
|
|
35
|
+
name: () => name,
|
|
36
|
+
schema: () => schema,
|
|
37
|
+
usage: () => usage
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(src_exports);
|
|
40
|
+
var import_node_fs = __toESM(require("node:fs"));
|
|
41
|
+
var import_node_path = __toESM(require("node:path"));
|
|
42
|
+
var import_node_crypto = __toESM(require("node:crypto"));
|
|
43
|
+
var import_sharp = __toESM(require("sharp"));
|
|
44
|
+
var import_koishi = require("koishi");
|
|
45
|
+
var name = "jryspro-fast";
|
|
46
|
+
var logger = new import_koishi.Logger(name);
|
|
47
|
+
var usage = `
|
|
48
|
+
## 更新插件前请停止运行插件
|
|
49
|
+
插件配置项可能会有改动,不停止插件直接更新可能会导致koishi炸掉
|
|
50
|
+
|
|
51
|
+
## 使用说明
|
|
52
|
+
|
|
53
|
+
> 如果你无法使用此插件,请检查
|
|
54
|
+
> - 1. (使用命令时无反应,报错等)请检查指令是否有冲突或者是否正确安装vercelSatoriPngService
|
|
55
|
+
> - 2. 提示“发生未知错误”可能是没有获取到群友的uid,需要在数据库内刷新一下
|
|
56
|
+
> - 3. “数据出错”之类的提示不是本插件的提示,可能你装了其他插件
|
|
57
|
+
> - 4. 启用不了插件。请检查koishi版本,vercelSatoriPngService版本等是否再兼容范围内,或重启koishi,删除此插件依赖再尝试重装
|
|
58
|
+
|
|
59
|
+
随机文件夹内图片时请注意路径\`C:/user/path/to/\`不要把后面的/忘了
|
|
60
|
+
|
|
61
|
+
## api说明
|
|
62
|
+
* api url以 #e# 结尾可以在末尾添加更新时间戳(例子后面等价的数字为当前时间戳)
|
|
63
|
+
* 例: https://api.example.com/img?#e# ==等价于== https://api.example.com/img?271878
|
|
64
|
+
* 例: https://api.example.com/img?type=acc&v=#e# ==等价于== https://api.example.com/img?type=acc&v=271878
|
|
65
|
+
|
|
66
|
+
imgApi与subimgApi支持本地文件夹绝对路径和http(s)等网络api
|
|
67
|
+
`;
|
|
68
|
+
var schema = import_koishi.Schema.object({
|
|
69
|
+
interval: import_koishi.Schema.number().default(3e4).description("指令调用间隔(单位ms)[需要加载数据库]"),
|
|
70
|
+
nightauto: import_koishi.Schema.boolean().default(true).description("是否开启自动夜间模式"),
|
|
71
|
+
nightStart: import_koishi.Schema.number().default(19).description(
|
|
72
|
+
"自动夜间模式开启时间整点(24时制),结束时间要小于开始时间[晚上]"
|
|
73
|
+
),
|
|
74
|
+
nightEnd: import_koishi.Schema.number().default(8).description(
|
|
75
|
+
"自动夜间模式关闭时间整点(24时制),结束时间要小于开始时间[早上]"
|
|
76
|
+
),
|
|
77
|
+
imgApi: import_koishi.Schema.string().role("link").required().description(
|
|
78
|
+
"[必填]渲染模式美图的api或文件夹(推荐纯竖屏),仅支持返回图片的api,不要忘记http(s)://"
|
|
79
|
+
),
|
|
80
|
+
imgQuality: import_koishi.Schema.percent().default(0.4).description("渲染图输出质量"),
|
|
81
|
+
waiting: import_koishi.Schema.boolean().default(true).description("是否开启发送消息等待提示"),
|
|
82
|
+
callme: import_koishi.Schema.boolean().default(false).description("是否开启callme功能"),
|
|
83
|
+
defaultMode: import_koishi.Schema.union([0, 1, 2, 3]).default(2).description(
|
|
84
|
+
"选择默认输出模式: 0.图片渲染,1.纯文本,2.新版竖屏,3.图文结合"
|
|
85
|
+
),
|
|
86
|
+
subimgApi: import_koishi.Schema.string().role("link").description(
|
|
87
|
+
"图文模式图片的api或文件夹,仅支持返回图片的api,不要忘记http(s)://"
|
|
88
|
+
),
|
|
89
|
+
avatarUrl: import_koishi.Schema.string().role("link").description("默认头像URL(https?://或者file:///)")
|
|
90
|
+
});
|
|
91
|
+
var inject = ["vercelSatoriPngService", "database"];
|
|
92
|
+
function apply(ctx, config) {
|
|
93
|
+
let fileType;
|
|
94
|
+
const template = import_node_fs.default.readFileSync(import_node_path.default.join(__dirname, "./template.html"), "utf8").replace(/[\s\S]*<body[^>]*>([\s\S]*)<\/body>[\s\S]*/, "$1").trim();
|
|
95
|
+
const template2 = import_node_fs.default.readFileSync(import_node_path.default.join(__dirname, "./template2.html"), "utf8").replace(/[\s\S]*<body[^>]*>([\s\S]*)<\/body>[\s\S]*/, "$1").trim();
|
|
96
|
+
const defaultAvatar = `data:image/png;base64,` + Buffer.from(import_node_fs.default.readFileSync(import_node_path.default.join(__dirname, "./avatar.png"))).toString(
|
|
97
|
+
"base64"
|
|
98
|
+
);
|
|
99
|
+
const jrysJson = JSON.parse(
|
|
100
|
+
import_node_fs.default.readFileSync(import_node_path.default.join(__dirname, "./jrys.json"), "utf8")
|
|
101
|
+
);
|
|
102
|
+
ctx.command(
|
|
103
|
+
"jryspro-fast",
|
|
104
|
+
`查看今日运势(${config.nightStart % 24}~${config.nightEnd % 24}点自动夜间模式)`,
|
|
105
|
+
{ minInterval: config.interval ? config.interval : 3e4 }
|
|
106
|
+
).alias("jrys").alias("今日运势").option("out", "-o 仅输出纯文本").option("nonight", "-n 无视夜间模式输出").option("txtimg", "-t 图文输出").option("img", "-i 渲染输出").option("debug", "-d 调试").option("new", "-N 新版输出").userFields(["name"]).action(async ({ session, options }) => {
|
|
107
|
+
if (config.nightEnd % 24 > config.nightStart % 24) {
|
|
108
|
+
config.nightStart = 19;
|
|
109
|
+
config.nightEnd = 8;
|
|
110
|
+
}
|
|
111
|
+
if (config.defaultMode > 3) config.defaultMode = 0;
|
|
112
|
+
let name2;
|
|
113
|
+
if (ctx.database && config.callme) {
|
|
114
|
+
name2 = session.user.name ? session.user.name : session.username;
|
|
115
|
+
}
|
|
116
|
+
if (!name2 && config.callme) {
|
|
117
|
+
name2 = session.author.name ? session.author.name : session.username;
|
|
118
|
+
} else {
|
|
119
|
+
name2 = session.username;
|
|
120
|
+
}
|
|
121
|
+
if (options.debug) {
|
|
122
|
+
const userKey = getUserKey(session);
|
|
123
|
+
return `Jrys Debugger: jrysNumber:${userKey.key}, etime: ${userKey.etime / 1e5}`;
|
|
124
|
+
}
|
|
125
|
+
let brightness;
|
|
126
|
+
const currentDate = /* @__PURE__ */ new Date();
|
|
127
|
+
const notNight = !config.nightauto || options.nonight || (config.nightEnd ? config.nightEnd : 8) <= currentDate.getHours() && currentDate.getHours() < (config.nightStart ? config.nightStart : 19);
|
|
128
|
+
if (notNight) {
|
|
129
|
+
brightness = "brightness(100%)";
|
|
130
|
+
} else {
|
|
131
|
+
brightness = "brightness(65%)";
|
|
132
|
+
}
|
|
133
|
+
const eTime = Date.now() % 25565 + "";
|
|
134
|
+
let backgroundUrl;
|
|
135
|
+
if (/^https?:\/\//i.test(config.imgApi)) {
|
|
136
|
+
backgroundUrl = config.imgApi.replace(/#e#$/gi, eTime);
|
|
137
|
+
} else {
|
|
138
|
+
backgroundUrl = "file:///" + import_node_path.default.resolve(
|
|
139
|
+
__dirname,
|
|
140
|
+
config.imgApi,
|
|
141
|
+
"." + import_node_path.default.sep,
|
|
142
|
+
import_koishi.Random.pick(await getFolderImg(config.imgApi))
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
let subImgUrl;
|
|
146
|
+
if (config.subimgApi) {
|
|
147
|
+
if (/^https?:\/\//i.test(config.subimgApi)) {
|
|
148
|
+
subImgUrl = config.imgApi.replace(/#e#$/gi, eTime);
|
|
149
|
+
} else {
|
|
150
|
+
subImgUrl = "file:///" + import_node_path.default.resolve(
|
|
151
|
+
__dirname,
|
|
152
|
+
config.subimgApi,
|
|
153
|
+
"." + import_node_path.default.sep,
|
|
154
|
+
import_koishi.Random.pick(await getFolderImg(config.subimgApi))
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const dJson = getJrys(session);
|
|
159
|
+
if (options.out || config.defaultMode === 1 && !options.img && !options.txtimg) {
|
|
160
|
+
return import_koishi.h.parse(
|
|
161
|
+
`<p>${name2}的今日运势为</p>
|
|
162
|
+
<p>${dJson.fortuneSummary}</p>
|
|
163
|
+
<p>${dJson.luckyStar}</p>
|
|
164
|
+
<p>${dJson.signText}</p>
|
|
165
|
+
<p>仅供娱乐|勿封建迷信|仅供娱乐</p>`
|
|
166
|
+
);
|
|
167
|
+
} else if (options.new || config.defaultMode === 2 && !options.out && !options.txtimg && !options.img) {
|
|
168
|
+
if (config.waiting) session.send("请稍等,正在查询……").then();
|
|
169
|
+
try {
|
|
170
|
+
const width = 640;
|
|
171
|
+
const height = 1080;
|
|
172
|
+
const avatarUrl = session.platform == "qq" ? `https://q.qlogo.cn/qqapp/${session.bot.config.id}/${session.event.user.id}/140` : session.author.avatar || config.avatarUrl || defaultAvatar;
|
|
173
|
+
const background = await downloadUrl({
|
|
174
|
+
url: backgroundUrl,
|
|
175
|
+
cover: {
|
|
176
|
+
width,
|
|
177
|
+
height
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
const avatar = await downloadUrl({
|
|
181
|
+
url: avatarUrl
|
|
182
|
+
});
|
|
183
|
+
const replacedContent = template.replace(
|
|
184
|
+
"https://dummyimage.com/389x399/6e2d6e/c2c5ed.png",
|
|
185
|
+
background.base64
|
|
186
|
+
).replace(
|
|
187
|
+
"https://dummyimage.com/99x99/6e2d6e/c2c5ed.png",
|
|
188
|
+
avatar.base64
|
|
189
|
+
).replace("brightness(100%)", brightness).replace(
|
|
190
|
+
"你是一个一个用户名啊啊啊啊啊啊啊啊啊啊啊啊",
|
|
191
|
+
name2.length > 12 ? name2.substring(0, 12) : name2
|
|
192
|
+
).replace(
|
|
193
|
+
"你是一个一个幸运星啊啊啊啊啊啊啊啊啊啊啊啊",
|
|
194
|
+
`${dJson.fortuneSummary.toString().length > 8 ? dJson.fortuneSummary.toString().substring(0, 8) : dJson.fortuneSummary} ${dJson.luckyStar}`
|
|
195
|
+
).replace(
|
|
196
|
+
"你是一个一个签名啊啊啊啊啊啊啊啊啊啊啊啊",
|
|
197
|
+
`${dJson.signText.split(",")[0]},${dJson.signText.split(",")[1]}<br/>${dJson.signText.split(",")[2]},${dJson.signText.split(",")[3]}`
|
|
198
|
+
);
|
|
199
|
+
const png = await ctx.vercelSatoriPngService.htmlToPng(
|
|
200
|
+
replacedContent,
|
|
201
|
+
{
|
|
202
|
+
width,
|
|
203
|
+
height
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
return [import_koishi.h.image((await png.toArray())[0], "image/png")];
|
|
207
|
+
} catch (err) {
|
|
208
|
+
logger.error(err);
|
|
209
|
+
return "渲染失败,不知道发生了啥";
|
|
210
|
+
}
|
|
211
|
+
} else if (options.img || config.defaultMode === 0 && !options.out && !options.txtimg && !options.new) {
|
|
212
|
+
if (config.waiting) session.send("请稍等,正在查询……").then();
|
|
213
|
+
try {
|
|
214
|
+
let width = 357;
|
|
215
|
+
const height = 1040;
|
|
216
|
+
const background = await downloadUrl({
|
|
217
|
+
url: backgroundUrl,
|
|
218
|
+
needMetadata: true
|
|
219
|
+
});
|
|
220
|
+
width += Math.round(
|
|
221
|
+
(height - 14) / background.metadata.height * background.metadata.width
|
|
222
|
+
);
|
|
223
|
+
const replacedContent = template2.replace(
|
|
224
|
+
/rgba\(255, 255, 255, 0\.6\)/g,
|
|
225
|
+
notNight ? "rgba(255, 255, 255, 0.6)" : "rgba(105, 105, 105, 0.6)"
|
|
226
|
+
).replace(
|
|
227
|
+
"0 0 15px rgba(0, 0, 0, 0.3)",
|
|
228
|
+
notNight ? "0 0 15px rgba(0, 0, 0, 0.3)" : "0 0 15px rgba(255, 255, 255, 0.3)"
|
|
229
|
+
).replace("brightness(100%)", brightness).replace("你是一个一个用户名啊啊啊啊啊啊啊啊啊啊啊啊", name2).replace(
|
|
230
|
+
"你是一个一个吉凶啊啊啊啊啊啊啊啊啊啊啊啊",
|
|
231
|
+
dJson.fortuneSummary
|
|
232
|
+
).replace(
|
|
233
|
+
"你是一个一个星星啊啊啊啊啊啊啊啊啊啊啊啊",
|
|
234
|
+
dJson.luckyStar
|
|
235
|
+
).replace(
|
|
236
|
+
"https://dummyimage.com/189x399/6e2d6e/c2c5ed.png",
|
|
237
|
+
background.base64
|
|
238
|
+
).replace(
|
|
239
|
+
/<!--签名开始-->[\s\S]*<!--签名结束-->/,
|
|
240
|
+
dJson.signText.split("").map((s) => `<div>${s}</div>`).join("")
|
|
241
|
+
).replace(
|
|
242
|
+
/<!--解签开始-->[\s\S]*<!--解签结束-->/,
|
|
243
|
+
dJson.unsignText.split("").map((s) => `<div>${s}</div>`).join("")
|
|
244
|
+
);
|
|
245
|
+
const png = await ctx.vercelSatoriPngService.htmlToPng(
|
|
246
|
+
replacedContent,
|
|
247
|
+
{
|
|
248
|
+
width,
|
|
249
|
+
height
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
return [import_koishi.h.image((await png.toArray())[0], "image/png")];
|
|
253
|
+
} catch (err) {
|
|
254
|
+
logger.error(err);
|
|
255
|
+
return "渲染失败,不知道发生了啥";
|
|
256
|
+
}
|
|
257
|
+
} else {
|
|
258
|
+
if (config.waiting) session.send("请稍等,正在查询……").then();
|
|
259
|
+
try {
|
|
260
|
+
const img = await downloadUrl({
|
|
261
|
+
url: subImgUrl || backgroundUrl
|
|
262
|
+
});
|
|
263
|
+
return import_koishi.h.parse(
|
|
264
|
+
`<p>${name2}的今日运势为</p>
|
|
265
|
+
<p>${dJson.fortuneSummary}</p>
|
|
266
|
+
<p>${dJson.luckyStar}</p>
|
|
267
|
+
<p>${dJson.signText}</p>
|
|
268
|
+
<img url="${img.base64}" alt="" />`
|
|
269
|
+
);
|
|
270
|
+
} catch (err) {
|
|
271
|
+
logger.error(err);
|
|
272
|
+
return import_koishi.h.parse(
|
|
273
|
+
`<p>${name2}的今日运势为</p>
|
|
274
|
+
<p>${dJson.fortuneSummary}</p>
|
|
275
|
+
<p>${dJson.luckyStar}</p>
|
|
276
|
+
<p>图片Url: ${subImgUrl || backgroundUrl}</p>`
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
async function loadFileType() {
|
|
282
|
+
if (!fileType) {
|
|
283
|
+
fileType = await import("file-type");
|
|
284
|
+
}
|
|
285
|
+
return fileType;
|
|
286
|
+
}
|
|
287
|
+
__name(loadFileType, "loadFileType");
|
|
288
|
+
function getUserKey(session) {
|
|
289
|
+
let etime = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0);
|
|
290
|
+
let userId;
|
|
291
|
+
if (!isNaN(+session.event.user.id)) {
|
|
292
|
+
userId = +session.event.user.id;
|
|
293
|
+
} else if (session.event.user.id) {
|
|
294
|
+
const hash = import_node_crypto.default.createHash("sha256");
|
|
295
|
+
hash.update(session.event.user.id + String(etime));
|
|
296
|
+
let hashHexDigest = hash.digest("hex");
|
|
297
|
+
userId = Number(parseInt(hashHexDigest, 16)) % 1000000001;
|
|
298
|
+
} else {
|
|
299
|
+
const md5 = import_node_crypto.default.createHash("md5");
|
|
300
|
+
md5.update(session.username + String(etime));
|
|
301
|
+
let hexDigest = md5.digest("hex");
|
|
302
|
+
userId = parseInt(hexDigest, 16) % 1000000001;
|
|
303
|
+
}
|
|
304
|
+
return {
|
|
305
|
+
key: etime / 1e5 * userId % 1000001 * 2333 % jrysJson.length,
|
|
306
|
+
etime
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
__name(getUserKey, "getUserKey");
|
|
310
|
+
function getJrys(session) {
|
|
311
|
+
return jrysJson[getUserKey(session).key];
|
|
312
|
+
}
|
|
313
|
+
__name(getJrys, "getJrys");
|
|
314
|
+
async function downloadUrl(args) {
|
|
315
|
+
const { url, cover, needMetadata } = args;
|
|
316
|
+
if (/^data:/i.test(url)) {
|
|
317
|
+
return { base64: url };
|
|
318
|
+
}
|
|
319
|
+
let imgData;
|
|
320
|
+
if (/^https?:/i.test(url)) {
|
|
321
|
+
imgData = Buffer.from(await ctx.http.get(url));
|
|
322
|
+
} else if (/^file:/i.test(url)) {
|
|
323
|
+
imgData = await import_node_fs.default.promises.readFile(url.replace(/^file:\/+/, ""));
|
|
324
|
+
} else {
|
|
325
|
+
logger.error("未知url类型");
|
|
326
|
+
throw "渲染失败,不知道发生了啥";
|
|
327
|
+
}
|
|
328
|
+
await loadFileType();
|
|
329
|
+
const imgType = await fileType.fileTypeFromBuffer(imgData);
|
|
330
|
+
let imgSharp;
|
|
331
|
+
let metadata;
|
|
332
|
+
const touchImgSharp = /* @__PURE__ */ __name(() => {
|
|
333
|
+
if (!imgSharp) {
|
|
334
|
+
imgSharp = (0, import_sharp.default)(imgData);
|
|
335
|
+
}
|
|
336
|
+
}, "touchImgSharp");
|
|
337
|
+
if (needMetadata) {
|
|
338
|
+
touchImgSharp();
|
|
339
|
+
metadata = await imgSharp.metadata();
|
|
340
|
+
}
|
|
341
|
+
if (cover) {
|
|
342
|
+
touchImgSharp();
|
|
343
|
+
if (!metadata) {
|
|
344
|
+
metadata = await imgSharp.metadata();
|
|
345
|
+
}
|
|
346
|
+
const newWh = {
|
|
347
|
+
width: cover.width,
|
|
348
|
+
height: cover.height
|
|
349
|
+
};
|
|
350
|
+
if (metadata.height * (cover.width / metadata.width) < cover.height) {
|
|
351
|
+
newWh.width = Math.round(
|
|
352
|
+
metadata.width * (cover.height / metadata.height)
|
|
353
|
+
);
|
|
354
|
+
} else {
|
|
355
|
+
newWh.height = Math.round(
|
|
356
|
+
metadata.height * (cover.width / metadata.width)
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
imgSharp.resize(newWh);
|
|
360
|
+
imgSharp.extract({
|
|
361
|
+
left: Math.round((newWh.width - cover.width) / 2),
|
|
362
|
+
width: cover.width,
|
|
363
|
+
top: Math.round((newWh.height - cover.height) / 2),
|
|
364
|
+
height: cover.height
|
|
365
|
+
});
|
|
366
|
+
if (imgType.ext !== "webp") {
|
|
367
|
+
imgData = await imgSharp.toBuffer();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
let mime = imgType.mime;
|
|
371
|
+
if (imgType.ext === "webp") {
|
|
372
|
+
touchImgSharp();
|
|
373
|
+
imgData = await imgSharp.png({}).toBuffer();
|
|
374
|
+
mime = "image/png";
|
|
375
|
+
}
|
|
376
|
+
return {
|
|
377
|
+
base64: `data:${mime};base64,` + imgData.toString("base64"),
|
|
378
|
+
metadata
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
__name(downloadUrl, "downloadUrl");
|
|
382
|
+
}
|
|
383
|
+
__name(apply, "apply");
|
|
384
|
+
async function getFolderImg(folder) {
|
|
385
|
+
return readFileNames(
|
|
386
|
+
folder,
|
|
387
|
+
(fileName) => /\.(png|jpg|jpeg|webp|svg)$/i.test(fileName)
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
__name(getFolderImg, "getFolderImg");
|
|
391
|
+
function readFileNames(dirPath, verify, basePath = "") {
|
|
392
|
+
let filenames = [];
|
|
393
|
+
const files = import_node_fs.default.readdirSync(dirPath);
|
|
394
|
+
files.forEach((filename) => {
|
|
395
|
+
const fullPath = import_node_path.default.join(dirPath, filename);
|
|
396
|
+
if (import_node_fs.default.statSync(fullPath).isDirectory()) {
|
|
397
|
+
filenames.push(
|
|
398
|
+
...readFileNames(fullPath, verify, import_node_path.default.join(basePath, filename))
|
|
399
|
+
);
|
|
400
|
+
} else if (verify(filename)) {
|
|
401
|
+
filenames.push(import_node_path.default.join(basePath, filename));
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
return filenames;
|
|
405
|
+
}
|
|
406
|
+
__name(readFileNames, "readFileNames");
|
|
407
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
408
|
+
0 && (module.exports = {
|
|
409
|
+
apply,
|
|
410
|
+
inject,
|
|
411
|
+
name,
|
|
412
|
+
schema,
|
|
413
|
+
usage
|
|
414
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "koishi-plugin-jryspro-fast",
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"main": "lib/index.js",
|
|
5
|
+
"typings": "lib/index.d.ts",
|
|
6
|
+
"homepage": "https://github.com/pgnqukezrdxmhjso/koishi-plugin-jryspro-fast",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/pgnqukezrdxmhjso/koishi-plugin-jryspro-fast.git"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "cd ../../ && yarn build jryspro-fast",
|
|
13
|
+
"pub": "cd ../../ && yarn pub jryspro-fast",
|
|
14
|
+
"fastPub": "cd ../../ && yarn bump -3 jryspro-fast && yarn build jryspro-fast && yarn pub jryspro-fast",
|
|
15
|
+
"test": "node src/test/test.js"
|
|
16
|
+
},
|
|
17
|
+
"contributors": [
|
|
18
|
+
"Twiyin0 <twiyin0@outlook.com>",
|
|
19
|
+
"vlssu <cmy1305300769@126.com>",
|
|
20
|
+
"pgnqukezrdxmhjso"
|
|
21
|
+
],
|
|
22
|
+
"files": [
|
|
23
|
+
"lib",
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"koishi": {
|
|
27
|
+
"browser": true,
|
|
28
|
+
"description": {
|
|
29
|
+
"en": "A jrys plugin with its own night mode and picture(Stop this plugin when you upgrade it)",
|
|
30
|
+
"zh": "一个自带夜间模式和美图的今日运势插件(更新前请停止插件)"
|
|
31
|
+
},
|
|
32
|
+
"service": {
|
|
33
|
+
"required": [
|
|
34
|
+
"http",
|
|
35
|
+
"vercelSatoriPngService"
|
|
36
|
+
],
|
|
37
|
+
"optional": [
|
|
38
|
+
"database"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"keywords": [
|
|
44
|
+
"chatbot",
|
|
45
|
+
"koishi",
|
|
46
|
+
"plugin",
|
|
47
|
+
"jrys",
|
|
48
|
+
"今日运势"
|
|
49
|
+
],
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"koishi": "^4.16.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"koishi-plugin-vercel-satori-png-service": "^0.1.5"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"file-type": "^21.0.0",
|
|
58
|
+
"sharp": "^0.34.3"
|
|
59
|
+
}
|
|
60
|
+
}
|