koishi-plugin-bilibili-notify 3.0.0-alpha.12 → 3.0.0-alpha.13

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/index.js CHANGED
@@ -38,18 +38,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Config = exports.name = exports.inject = void 0;
40
40
  exports.apply = apply;
41
- /* eslint-disable @typescript-eslint/ban-types */
42
41
  const koishi_1 = require("koishi");
43
42
  // import plugins
44
- // import Authority from './authority'
45
43
  const comRegister_1 = __importDefault(require("./comRegister"));
46
44
  const Database = __importStar(require("./database"));
47
45
  // import Service
48
46
  const generateImg_1 = __importDefault(require("./generateImg"));
49
47
  const biliAPI_1 = __importDefault(require("./biliAPI"));
50
48
  const blive_1 = __importDefault(require("./blive"));
51
- exports.inject = ['puppeteer', 'database', 'notifier'];
52
- exports.name = 'bilibili-notify';
49
+ exports.inject = ["puppeteer", "canvas", "database", "notifier"];
50
+ exports.name = "bilibili-notify";
53
51
  let globalConfig;
54
52
  class ServerManager extends koishi_1.Service {
55
53
  // 服务
@@ -59,81 +57,83 @@ class ServerManager extends koishi_1.Service {
59
57
  // 动态循环时间
60
58
  dynamicLoopTime;
61
59
  constructor(ctx) {
62
- super(ctx, 'sm');
60
+ super(ctx, "sm");
63
61
  // 插件运行相关指令
64
- const sysCom = ctx.command('sys', 'bili-notify插件运行相关指令', { permissions: ['authority:5'] });
62
+ const sysCom = ctx.command("sys", "bili-notify插件运行相关指令", {
63
+ permissions: ["authority:5"],
64
+ });
65
65
  sysCom
66
- .subcommand('.restart', '重启插件')
67
- .usage('重启插件')
68
- .example('sys restart')
66
+ .subcommand(".restart", "重启插件")
67
+ .usage("重启插件")
68
+ .example("sys restart")
69
69
  .action(async () => {
70
- this.logger.info('调用sys restart指令');
70
+ this.logger.info("调用sys restart指令");
71
71
  if (await this.restartPlugin()) {
72
- return '插件重启成功';
72
+ return "插件重启成功";
73
73
  }
74
- return '插件重启失败';
74
+ return "插件重启失败";
75
75
  });
76
76
  sysCom
77
- .subcommand('.stop', '停止插件')
78
- .usage('停止插件')
79
- .example('sys stop')
77
+ .subcommand(".stop", "停止插件")
78
+ .usage("停止插件")
79
+ .example("sys stop")
80
80
  .action(async () => {
81
- this.logger.info('调用sys stop指令');
81
+ this.logger.info("调用sys stop指令");
82
82
  if (await this.disposePlugin()) {
83
- return '插件已停止';
83
+ return "插件已停止";
84
84
  }
85
- return '停止插件失败';
85
+ return "停止插件失败";
86
86
  });
87
87
  sysCom
88
- .subcommand('.start', '启动插件')
89
- .usage('启动插件')
90
- .example('sys start')
88
+ .subcommand(".start", "启动插件")
89
+ .usage("启动插件")
90
+ .example("sys start")
91
91
  .action(async () => {
92
- this.logger.info('调用sys start指令');
92
+ this.logger.info("调用sys start指令");
93
93
  if (await this.registerPlugin()) {
94
- return '插件启动成功';
94
+ return "插件启动成功";
95
95
  }
96
- return '插件启动失败';
96
+ return "插件启动失败";
97
97
  });
98
98
  }
99
99
  start() {
100
100
  // 加载配置
101
101
  // 根据用户设置的渲染模式设置
102
102
  switch (globalConfig.renderType) {
103
- case 'render':
103
+ case "render":
104
104
  this.renderType = 0;
105
105
  break;
106
- case 'page':
106
+ case "page":
107
107
  this.renderType = 1;
108
108
  break;
109
109
  }
110
110
  // 转换为具体时间
111
111
  switch (globalConfig.dynamicLoopTime) {
112
- case '1分钟':
112
+ case "1分钟":
113
113
  this.dynamicLoopTime = 60;
114
114
  break;
115
- case '2分钟':
115
+ case "2分钟":
116
116
  this.dynamicLoopTime = 120;
117
117
  break;
118
- case '3分钟':
118
+ case "3分钟":
119
119
  this.dynamicLoopTime = 180;
120
120
  break;
121
- case '5分钟':
121
+ case "5分钟":
122
122
  this.dynamicLoopTime = 300;
123
123
  break;
124
- case '10分钟':
124
+ case "10分钟":
125
125
  this.dynamicLoopTime = 600;
126
126
  break;
127
- case '20分钟':
127
+ case "20分钟":
128
128
  this.dynamicLoopTime = 1200;
129
129
  break;
130
130
  }
131
131
  // 注册插件
132
132
  if (this.registerPlugin()) {
133
- this.logger.info('插件启动成功');
133
+ this.logger.info("插件启动成功");
134
134
  }
135
135
  else {
136
- this.logger.error('插件启动失败');
136
+ this.logger.error("插件启动失败");
137
137
  }
138
138
  }
139
139
  registerPlugin = () => {
@@ -145,7 +145,7 @@ class ServerManager extends koishi_1.Service {
145
145
  // BA = BiliAPI
146
146
  const ba = this.ctx.plugin(biliAPI_1.default, {
147
147
  userAgent: globalConfig.userAgent,
148
- key: globalConfig.key
148
+ key: globalConfig.key,
149
149
  });
150
150
  // GI = GenerateImg
151
151
  const gi = this.ctx.plugin(generateImg_1.default, {
@@ -156,7 +156,7 @@ class ServerManager extends koishi_1.Service {
156
156
  cardColorEnd: globalConfig.cardColorEnd,
157
157
  hideDesc: globalConfig.hideDesc,
158
158
  enableLargeFont: globalConfig.enableLargeFont,
159
- font: globalConfig.font
159
+ font: globalConfig.font,
160
160
  });
161
161
  // CR = ComRegister
162
162
  const cr = this.ctx.plugin(comRegister_1.default, {
@@ -173,7 +173,7 @@ class ServerManager extends koishi_1.Service {
173
173
  dynamicLoopTime: this.dynamicLoopTime,
174
174
  dynamicUrl: globalConfig.dynamicUrl,
175
175
  filter: globalConfig.filter,
176
- dynamicDebugMode: globalConfig.dynamicDebugMode
176
+ dynamicDebugMode: globalConfig.dynamicDebugMode,
177
177
  });
178
178
  // BL = BLive
179
179
  const bl = this.ctx.plugin(blive_1.default);
@@ -184,10 +184,10 @@ class ServerManager extends koishi_1.Service {
184
184
  this.servers.push(cr);
185
185
  }
186
186
  catch (e) {
187
- this.logger.error('插件注册失败', e);
187
+ this.logger.error("插件注册失败", e);
188
188
  return false;
189
189
  }
190
- // 成功返回true
190
+ // 成功返回true
191
191
  return true;
192
192
  };
193
193
  disposePlugin = async () => {
@@ -195,13 +195,13 @@ class ServerManager extends koishi_1.Service {
195
195
  if (this.servers.length === 0)
196
196
  return false;
197
197
  // 遍历服务
198
- await new Promise(resolve => {
199
- this.servers.forEach(fork => {
198
+ await new Promise((resolve) => {
199
+ for (const fork of this.servers) {
200
200
  fork.dispose();
201
- });
201
+ }
202
202
  // 清空服务
203
203
  this.servers = [];
204
- resolve('ok');
204
+ resolve("ok");
205
205
  });
206
206
  // 成功返回true
207
207
  return true;
@@ -213,13 +213,13 @@ class ServerManager extends koishi_1.Service {
213
213
  // 停用插件
214
214
  await this.disposePlugin();
215
215
  // 隔一秒启动插件
216
- return new Promise(resolve => {
216
+ return new Promise((resolve) => {
217
217
  this.ctx.setTimeout(() => {
218
218
  try {
219
219
  this.registerPlugin();
220
220
  }
221
221
  catch (e) {
222
- this.logger.error('重启插件失败', e);
222
+ this.logger.error("重启插件失败", e);
223
223
  resolve(false);
224
224
  }
225
225
  resolve(true);
@@ -232,16 +232,17 @@ function apply(ctx, config) {
232
232
  globalConfig = config;
233
233
  // 设置提示
234
234
  ctx.notifier.create({
235
- content: '从3.0.0-alpha.10以前版本更新需重新订阅'
235
+ content: "从3.0.0-alpha.10以前版本更新需重新订阅",
236
236
  });
237
237
  ctx.notifier.create({
238
- content: '请使用Auth插件创建超级管理员账号,没有权限将无法使用该插件提供的指令。'
238
+ content: "请使用Auth插件创建超级管理员账号,没有权限将无法使用该插件提供的指令。",
239
239
  });
240
- if (config.unlockSubLimits) { // 用户允许订阅超过三个用户
240
+ if (config.unlockSubLimits) {
241
+ // 用户允许订阅超过三个用户
241
242
  // 设置警告
242
243
  ctx.notifier.create({
243
- type: 'danger',
244
- content: '过多的订阅可能会导致IP暂时被封禁!'
244
+ type: "danger",
245
+ content: "过多的订阅可能会导致IP暂时被封禁!",
245
246
  });
246
247
  }
247
248
  // load database
@@ -250,152 +251,164 @@ function apply(ctx, config) {
250
251
  ctx.plugin(ServerManager);
251
252
  // 当用户输入“恶魔兔,启动!”时,执行 help 指令
252
253
  ctx.middleware((session, next) => {
253
- if (session.content === '恶魔兔,启动!') {
254
- return session.send('启动不了一点');
255
- }
256
- else {
257
- return next();
254
+ if (session.content === "恶魔兔,启动!") {
255
+ return session.send("启动不了一点");
258
256
  }
257
+ return next();
259
258
  });
260
259
  }
261
260
  exports.Config = koishi_1.Schema.object({
262
- require: koishi_1.Schema.object({}).description('必填设置'),
261
+ require: koishi_1.Schema.object({}).description("必填设置"),
263
262
  key: koishi_1.Schema.string()
264
263
  .pattern(/^[0-9a-f]{32}$/)
265
- .role('secret')
264
+ .role("secret")
266
265
  .required()
267
- .description('请输入一个32位小写字母的十六进制密钥(例如:9b8db7ae562b9864efefe06289cc5530),使用此密钥将你的B站登录信息存储在数据库中,请一定保存好此密钥。如果你忘记了此密钥,必须重新登录。你可以自行生成,或到这个网站生成:https://www.sexauth.com/'),
266
+ .description("请输入一个32位小写字母的十六进制密钥(例如:9b8db7ae562b9864efefe06289cc5530),使用此密钥将你的B站登录信息存储在数据库中,请一定保存好此密钥。如果你忘记了此密钥,必须重新登录。你可以自行生成,或到这个网站生成:https://www.sexauth.com/"),
268
267
  master: koishi_1.Schema.intersect([
269
268
  koishi_1.Schema.object({
270
269
  enable: koishi_1.Schema.boolean()
271
270
  .default(false)
272
- .description('是否开启主人账号功能,如果您的机器人没有私聊权限请不要开启此功能。开启后如果机器人运行错误会向您进行报告')
273
- }).description('主人账号'),
271
+ .description("是否开启主人账号功能,如果您的机器人没有私聊权限请不要开启此功能。开启后如果机器人运行错误会向您进行报告"),
272
+ }).description("主人账号"),
274
273
  koishi_1.Schema.union([
275
274
  koishi_1.Schema.object({
276
275
  enable: koishi_1.Schema.const(true).required(),
277
- platform: koishi_1.Schema.union(['qq', 'qqguild', 'onebot', 'discord', 'red', 'telegram', 'satori', 'chronocat', 'lark'])
278
- .description('请选择您的私人机器人平台,目前支持QQ、QQ群、OneBot、Discord、RedBot、Telegram、Satori、ChronoCat、Lark。从2.0版本开始,只能在一个平台下使用本插件'),
276
+ platform: koishi_1.Schema.union([
277
+ "qq",
278
+ "qqguild",
279
+ "onebot",
280
+ "discord",
281
+ "red",
282
+ "telegram",
283
+ "satori",
284
+ "chronocat",
285
+ "lark",
286
+ ]).description("请选择您的私人机器人平台,目前支持QQ、QQ群、OneBot、Discord、RedBot、Telegram、Satori、ChronoCat、Lark。从2.0版本开始,只能在一个平台下使用本插件"),
279
287
  masterAccount: koishi_1.Schema.string()
280
- .role('secret')
288
+ .role("secret")
281
289
  .required()
282
- .description('主人账号,在Q群使用可直接使用QQ号,若在其他平台使用,请使用inspect插件获取自身ID'),
290
+ .description("主人账号,在Q群使用可直接使用QQ号,若在其他平台使用,请使用inspect插件获取自身ID"),
283
291
  masterAccountGuildId: koishi_1.Schema.string()
284
- .role('secret')
285
- .description('主人账号所在的群组ID,只有在QQ频道、Discord这样的环境才需要填写,请使用inspect插件获取群组ID'),
292
+ .role("secret")
293
+ .description("主人账号所在的群组ID,只有在QQ频道、Discord这样的环境才需要填写,请使用inspect插件获取群组ID"),
286
294
  }),
287
- koishi_1.Schema.object({})
288
- ])
295
+ koishi_1.Schema.object({}),
296
+ ]),
289
297
  ]),
290
- basicSettings: koishi_1.Schema.object({}).description('基本设置'),
298
+ basicSettings: koishi_1.Schema.object({}).description("基本设置"),
291
299
  unlockSubLimits: koishi_1.Schema.boolean()
292
300
  .default(false)
293
- .description('解锁3个直播订阅限制,默认只允许订阅3位UP主。订阅过多用户可能有导致IP暂时被封禁的风险'),
301
+ .description("解锁3个直播订阅限制,默认只允许订阅3位UP主。订阅过多用户可能有导致IP暂时被封禁的风险"),
294
302
  automaticResend: koishi_1.Schema.boolean()
295
303
  .default(true)
296
- .description('是否开启自动重发功能,默认开启。开启后,如果推送失败,将会自动重发,尝试三次。关闭后,推送失败将不会再重发,直到下一次推送'),
297
- renderType: koishi_1.Schema.union(['render', 'page'])
298
- .role('')
299
- .default('render')
300
- .description('渲染类型,默认为render模式,渲染速度更快,但会出现乱码问题,若出现乱码问题,请切换到page模式。若使用自定义字体,建议选择render模式'),
304
+ .description("是否开启自动重发功能,默认开启。开启后,如果推送失败,将会自动重发,尝试三次。关闭后,推送失败将不会再重发,直到下一次推送"),
305
+ renderType: koishi_1.Schema.union(["render", "page"])
306
+ .role("")
307
+ .default("render")
308
+ .description("渲染类型,默认为render模式,渲染速度更快,但会出现乱码问题,若出现乱码问题,请切换到page模式。若使用自定义字体,建议选择render模式"),
301
309
  userAgent: koishi_1.Schema.string()
302
310
  .required()
303
- .description('设置请求头User-Agen,请求出现-352时可以尝试修改,UA获取方法可参考:https://blog.csdn.net/qq_44503987/article/details/104929111'),
304
- subTitle: koishi_1.Schema.object({}).description('手动订阅'),
311
+ .description("设置请求头User-Agen,请求出现-352时可以尝试修改,UA获取方法可参考:https://blog.csdn.net/qq_44503987/article/details/104929111"),
312
+ subTitle: koishi_1.Schema.object({}).description("手动订阅"),
305
313
  sub: koishi_1.Schema.array(koishi_1.Schema.object({
306
- uid: koishi_1.Schema.string().description('订阅用户UID'),
307
- dynamic: koishi_1.Schema.boolean().description('是否订阅用户动态'),
308
- live: koishi_1.Schema.boolean().description('是否订阅用户直播'),
314
+ uid: koishi_1.Schema.string().description("订阅用户UID"),
315
+ dynamic: koishi_1.Schema.boolean().description("是否订阅用户动态"),
316
+ live: koishi_1.Schema.boolean().description("是否订阅用户直播"),
309
317
  target: koishi_1.Schema.array(koishi_1.Schema.object({
310
318
  channelIdArr: koishi_1.Schema.array(koishi_1.Schema.object({
311
- channelId: koishi_1.Schema.string().description('频道/群组号'),
312
- dynamic: koishi_1.Schema.boolean().description('该频道/群组是否推送动态信息'),
313
- live: koishi_1.Schema.boolean().description('该频道/群组是否推送直播通知'),
314
- liveGuardBuy: koishi_1.Schema.boolean().description('该频道/群组是否推送上舰消息'),
315
- atAll: koishi_1.Schema.boolean().description('推送开播通知时是否艾特全体成员')
316
- })).description('频道/群组信息'),
317
- platform: koishi_1.Schema.string().description('推送平台')
318
- })).description('订阅用户需要发送的频道/群组信息')
319
- })).role('table').description('手动输入订阅信息,方便自定义订阅内容,这里的订阅内容不会存入数据库。uid: 订阅用户UID,dynamic: 是否需要订阅动态,live: 是否需要订阅直播'),
320
- dynamic: koishi_1.Schema.object({}).description('动态推送设置'),
319
+ channelId: koishi_1.Schema.string().description("频道/群组号"),
320
+ dynamic: koishi_1.Schema.boolean().description("该频道/群组是否推送动态信息"),
321
+ live: koishi_1.Schema.boolean().description("该频道/群组是否推送直播通知"),
322
+ liveGuardBuy: koishi_1.Schema.boolean().description("该频道/群组是否推送上舰消息"),
323
+ atAll: koishi_1.Schema.boolean().description("推送开播通知时是否艾特全体成员"),
324
+ })).description("频道/群组信息"),
325
+ platform: koishi_1.Schema.string().description("推送平台"),
326
+ })).description("订阅用户需要发送的频道/群组信息"),
327
+ }))
328
+ .role("table")
329
+ .description("手动输入订阅信息,方便自定义订阅内容,这里的订阅内容不会存入数据库。uid: 订阅用户UID,dynamic: 是否需要订阅动态,live: 是否需要订阅直播"),
330
+ dynamic: koishi_1.Schema.object({}).description("动态推送设置"),
321
331
  dynamicUrl: koishi_1.Schema.boolean()
322
332
  .default(false)
323
- .description('发送动态时是否同时发送链接。注意:如果使用的是QQ官方机器人不能开启此项!'),
324
- dynamicLoopTime: koishi_1.Schema.union(['1分钟', '2分钟', '3分钟', '5分钟', '10分钟', '20分钟'])
325
- .role('')
326
- .default('2分钟')
327
- .description('设定多久检测一次动态。若需动态的时效性,可以设置为1分钟。若订阅的UP主经常在短时间内连着发多条动态应该将该值提高,否则会出现动态漏推送和晚推送的问题,默认值为2分钟'),
328
- live: koishi_1.Schema.object({}).description('直播推送设置'),
333
+ .description("发送动态时是否同时发送链接。注意:如果使用的是QQ官方机器人不能开启此项!"),
334
+ dynamicLoopTime: koishi_1.Schema.union([
335
+ "1分钟",
336
+ "2分钟",
337
+ "3分钟",
338
+ "5分钟",
339
+ "10分钟",
340
+ "20分钟",
341
+ ])
342
+ .role("")
343
+ .default("2分钟")
344
+ .description("设定多久检测一次动态。若需动态的时效性,可以设置为1分钟。若订阅的UP主经常在短时间内连着发多条动态应该将该值提高,否则会出现动态漏推送和晚推送的问题,默认值为2分钟"),
345
+ live: koishi_1.Schema.object({}).description("直播推送设置"),
329
346
  liveDetectMode: koishi_1.Schema.union([
330
- koishi_1.Schema.const('WS').description('WebSocket模式:连接到对应的直播间,可推送弹幕消息,开播下播响应最快,但对订阅数有限制'),
331
- koishi_1.Schema.const('API').description('API模式:请求对应直播间API,无法获取弹幕消息,开播下播响应慢,理论可无限订阅').experimental()
347
+ koishi_1.Schema.const("WS").description("WebSocket模式:连接到对应的直播间,可推送弹幕消息,开播下播响应最快,但对订阅数有限制"),
348
+ koishi_1.Schema.const("API")
349
+ .description("API模式:请求对应直播间API,无法获取弹幕消息,开播下播响应慢,理论可无限订阅")
350
+ .experimental(),
332
351
  ])
333
- .role('radio')
334
- .description('直播检测模式')
335
- .default('WS'),
352
+ .role("radio")
353
+ .description("直播检测模式")
354
+ .default("WS"),
336
355
  restartPush: koishi_1.Schema.boolean()
337
356
  .default(true)
338
- .description('插件重启后,如果订阅的主播正在直播,是否进行一次推送,默认开启'),
357
+ .description("插件重启后,如果订阅的主播正在直播,是否进行一次推送,默认开启"),
339
358
  pushTime: koishi_1.Schema.number()
340
359
  .min(0)
341
360
  .max(12)
342
361
  .step(0.5)
343
362
  .default(1)
344
- .description('设定间隔多长时间推送一次直播状态,单位为小时,默认为一小时'),
363
+ .description("设定间隔多长时间推送一次直播状态,单位为小时,默认为一小时"),
345
364
  customLiveStart: koishi_1.Schema.string()
346
- .default('-name开播啦 -link')
347
- .description('自定义开播提示语,-name代表UP昵称,-link代表直播间链接(如果使用的是QQ官方机器人,请不要使用)。例如-name开播啦,会发送为xxxUP开播啦'),
348
- customLive: koishi_1.Schema.string()
349
- .description('自定义直播中提示语,-name代表UP昵称,-time代表开播时长,-link代表直播间链接(如果使用的是QQ官方机器人,请不要使用)。例如-name正在直播,会发送为xxxUP正在直播xxx'),
365
+ .default("-name开播啦 -link")
366
+ .description("自定义开播提示语,-name代表UP昵称,-link代表直播间链接(如果使用的是QQ官方机器人,请不要使用)。例如-name开播啦,会发送为xxxUP开播啦"),
367
+ customLive: koishi_1.Schema.string().description("自定义直播中提示语,-name代表UP昵称,-time代表开播时长,-link代表直播间链接(如果使用的是QQ官方机器人,请不要使用)。例如-name正在直播,会发送为xxxUP正在直播xxx"),
350
368
  customLiveEnd: koishi_1.Schema.string()
351
- .default('-name下播啦,本次直播了-time')
352
- .description('自定义下播提示语,-name代表UP昵称,-time代表开播时长。例如-name下播啦,本次直播了-time,会发送为xxxUP下播啦,直播时长为xx小时xx分钟xx秒'),
369
+ .default("-name下播啦,本次直播了-time")
370
+ .description("自定义下播提示语,-name代表UP昵称,-time代表开播时长。例如-name下播啦,本次直播了-time,会发送为xxxUP下播啦,直播时长为xx小时xx分钟xx秒"),
353
371
  hideDesc: koishi_1.Schema.boolean()
354
372
  .default(false)
355
- .description('是否隐藏UP主直播间简介,开启后推送的直播卡片将不再展示简介'),
356
- style: koishi_1.Schema.object({}).description('美化设置'),
357
- removeBorder: koishi_1.Schema.boolean()
358
- .default(false)
359
- .description('移除推送卡片边框'),
373
+ .description("是否隐藏UP主直播间简介,开启后推送的直播卡片将不再展示简介"),
374
+ style: koishi_1.Schema.object({}).description("美化设置"),
375
+ removeBorder: koishi_1.Schema.boolean().default(false).description("移除推送卡片边框"),
360
376
  cardColorStart: koishi_1.Schema.string()
361
377
  .pattern(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
362
- .default('#F38AB5')
363
- .description('推送卡片的开始渐变背景色,请填入16进制颜色代码,参考网站:https://webkul.github.io/coolhue/'),
378
+ .default("#F38AB5")
379
+ .description("推送卡片的开始渐变背景色,请填入16进制颜色代码,参考网站:https://webkul.github.io/coolhue/"),
364
380
  cardColorEnd: koishi_1.Schema.string()
365
381
  .pattern(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
366
- .default('#F9CCDF')
367
- .description('推送卡片的结束渐变背景色,请填入16进制颜色代码,参考网站:https://colorate.azurewebsites.net/'),
382
+ .default("#F9CCDF")
383
+ .description("推送卡片的结束渐变背景色,请填入16进制颜色代码,参考网站:https://colorate.azurewebsites.net/"),
368
384
  enableLargeFont: koishi_1.Schema.boolean()
369
385
  .default(false)
370
- .description('是否开启动态推送卡片大字体模式,默认为小字体。小字体更漂亮,但阅读比较吃力,大字体更易阅读,但相对没这么好看'),
371
- font: koishi_1.Schema.string()
372
- .description('推送卡片的字体样式,如果你想用你自己的字体可以在此填写,例如:Microsoft YaHei'),
386
+ .description("是否开启动态推送卡片大字体模式,默认为小字体。小字体更漂亮,但阅读比较吃力,大字体更易阅读,但相对没这么好看"),
387
+ font: koishi_1.Schema.string().description("推送卡片的字体样式,如果你想用你自己的字体可以在此填写,例如:Microsoft YaHei"),
373
388
  filter: koishi_1.Schema.intersect([
374
389
  koishi_1.Schema.object({
375
390
  enable: koishi_1.Schema.boolean()
376
391
  .default(false)
377
- .description('是否开启动态屏蔽功能')
378
- }).description('屏蔽设置'),
392
+ .description("是否开启动态屏蔽功能"),
393
+ }).description("屏蔽设置"),
379
394
  koishi_1.Schema.union([
380
395
  koishi_1.Schema.object({
381
396
  enable: koishi_1.Schema.const(true).required().experimental(),
382
397
  notify: koishi_1.Schema.boolean()
383
398
  .default(false)
384
- .description('动态被屏蔽是否发送提示'),
385
- regex: koishi_1.Schema.string()
386
- .description('正则表达式屏蔽'),
387
- keywords: koishi_1.Schema.array(String)
388
- .description('关键字屏蔽,一个关键字为一项'),
399
+ .description("动态被屏蔽是否发送提示"),
400
+ regex: koishi_1.Schema.string().description("正则表达式屏蔽"),
401
+ keywords: koishi_1.Schema.array(String).description("关键字屏蔽,一个关键字为一项"),
389
402
  forward: koishi_1.Schema.boolean()
390
403
  .default(false)
391
404
  .description("是否屏蔽转发动态"),
392
405
  }),
393
- koishi_1.Schema.object({})
394
- ])
406
+ koishi_1.Schema.object({}),
407
+ ]),
395
408
  ]),
396
- debug: koishi_1.Schema.object({}).description('调试设置'),
409
+ debug: koishi_1.Schema.object({}).description("调试设置"),
397
410
  dynamicDebugMode: koishi_1.Schema.boolean()
398
411
  .default(false)
399
- .description('动态调试模式,开启后会在控制台输出动态推送的详细信息,用于调试')
400
- .experimental()
412
+ .description("动态调试模式,开启后会在控制台输出动态推送的详细信息,用于调试")
413
+ .experimental(),
401
414
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-bilibili-notify",
3
3
  "description": "Koishi bilibili notify plugin",
4
- "version": "3.0.0-alpha.12",
4
+ "version": "3.0.0-alpha.13",
5
5
  "contributors": [
6
6
  "Akokko <admin@akokko.com>"
7
7
  ],
@@ -30,7 +30,6 @@
30
30
  "axios": "^1.7.9",
31
31
  "axios-cookiejar-support": "^5.0.5",
32
32
  "blive-message-listener": "^0.5.0",
33
- "d3-cloud": "^1.2.7",
34
33
  "jsdom": "^24.1.3",
35
34
  "luxon": "^3.5.0",
36
35
  "md5": "^2.3.0",
@@ -39,16 +38,13 @@
39
38
  "tough-cookie": "^4.1.4"
40
39
  },
41
40
  "devDependencies": {
42
- "@eslint/js": "^9.20.0",
43
- "@types/d3-cloud": "^1",
41
+ "@biomejs/biome": "1.9.4",
44
42
  "@types/luxon": "^3.4.2",
45
43
  "@types/md5": "^2.3.5",
46
44
  "@types/qrcode": "^1.5.5",
47
45
  "@types/tough-cookie": "^4.0.5",
48
- "eslint": "^9.20.0",
49
46
  "globals": "^15.14.0",
50
- "koishi-plugin-puppeteer": "^3.9.0",
51
- "typescript-eslint": "^7.18.1-alpha.3"
47
+ "koishi-plugin-puppeteer": "^3.9.0"
52
48
  },
53
49
  "koishi": {
54
50
  "service": {
package/readme.md CHANGED
@@ -224,6 +224,7 @@
224
224
  - ver 3.0.0-alpha.10 修复:连续推送两次开播通知
225
225
  - ver 3.0.0-alpha.11 新增:直播结束后推送弹幕词云,直播推送上舰消息; 修复:直播推送都是同一张画面; 移除:直播推送弹幕消息
226
226
  - ver 3.0.0-alpha.12 修复:上一版本无法安装
227
+ - ver 3.0.0-alpha.13 优化:将ESLint替换为Biome; 修复:增加弹幕词云功能产生的bug; 禁用:弹幕词云功能并不难正常运作,暂时将该功能禁用
227
228
 
228
229
  ## 交流群
229
230