koishi-plugin-bilibili-notify 1.0.3 → 1.0.4-alpha.1
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/lib/0.html +0 -0
- package/lib/biliAPI.d.ts +1 -1
- package/lib/biliAPI.js +18 -6
- package/lib/comRegister.d.ts +1 -1
- package/lib/comRegister.js +72 -67
- package/lib/generateImg.d.ts +20 -4
- package/lib/generateImg.js +575 -521
- package/lib/index.d.ts +1 -0
- package/lib/index.js +23 -8
- package/package.json +1 -1
- package/readme.md +0 -2
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -56,6 +56,10 @@ exports.Config = koishi_1.Schema.object({
|
|
|
56
56
|
.role('')
|
|
57
57
|
.default('2分钟')
|
|
58
58
|
.description('设定多久检测一次动态。若需动态的时效性,可以设置为1分钟。若订阅的UP主经常在短时间内连着发多条动态应该将该值提高,否则会出现动态漏推送和晚推送的问题,默认值为2分钟'),
|
|
59
|
+
renderType: koishi_1.Schema.union(['render', 'page'])
|
|
60
|
+
.role('')
|
|
61
|
+
.default('render')
|
|
62
|
+
.description('渲染类型,默认为render模式,渲染速度更快,但会出现乱码问题,若出现乱码问题,请切换到page模式。若使用自定义字体,建议选择render模式'),
|
|
59
63
|
cardColorStart: koishi_1.Schema.string()
|
|
60
64
|
.pattern(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
|
|
61
65
|
.default('#F38AB5')
|
|
@@ -76,14 +80,7 @@ function apply(ctx, config) {
|
|
|
76
80
|
ctx.notifier.create({
|
|
77
81
|
content: '请记得使用Auth插件创建超级管理员账号,没有权限将无法使用该插件提供的指令。'
|
|
78
82
|
});
|
|
79
|
-
// load
|
|
80
|
-
ctx.plugin(Database);
|
|
81
|
-
// Regist server
|
|
82
|
-
ctx.plugin(wbi_1.default, { key: config.key });
|
|
83
|
-
ctx.plugin(generateImg_1.default, { cardColorStart: config.cardColorStart, cardColorEnd: config.cardColorEnd, font: config.font });
|
|
84
|
-
ctx.plugin(biliAPI_1.default);
|
|
85
|
-
// load plugin
|
|
86
|
-
// ctx.plugin(Authority)
|
|
83
|
+
// load config
|
|
87
84
|
// 转换为具体时间
|
|
88
85
|
let dynamicLoopTime;
|
|
89
86
|
switch (config.dynamicLoopTime) {
|
|
@@ -100,6 +97,24 @@ function apply(ctx, config) {
|
|
|
100
97
|
dynamicLoopTime = 300;
|
|
101
98
|
break;
|
|
102
99
|
}
|
|
100
|
+
// 渲染模式
|
|
101
|
+
let renderType;
|
|
102
|
+
switch (config.renderType) {
|
|
103
|
+
case 'render':
|
|
104
|
+
renderType = 0;
|
|
105
|
+
break;
|
|
106
|
+
case 'page':
|
|
107
|
+
renderType = 1;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
// load database
|
|
111
|
+
ctx.plugin(Database);
|
|
112
|
+
// Regist server
|
|
113
|
+
ctx.plugin(wbi_1.default, { key: config.key });
|
|
114
|
+
ctx.plugin(generateImg_1.default, { renderType, cardColorStart: config.cardColorStart, cardColorEnd: config.cardColorEnd, font: config.font });
|
|
115
|
+
ctx.plugin(biliAPI_1.default);
|
|
116
|
+
// load plugin
|
|
117
|
+
// ctx.plugin(Authority)
|
|
103
118
|
ctx.plugin(comRegister_1.default, { pushTime: config.pushTime, dynamicCheckNumber: config.dynamicCheckNumber, dynamicLoopTime });
|
|
104
119
|
// 当用户输入“恶魔兔,启动!”时,执行 help 指令
|
|
105
120
|
ctx.middleware((session, next) => {
|
package/package.json
CHANGED