koishi-plugin-bilibili-notify 1.2.0-rc.0 → 1.2.0-rc.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.
@@ -21,6 +21,7 @@ declare class ComRegister {
21
21
  qqguildBot: Bot<Context>;
22
22
  oneBot: Bot<Context>;
23
23
  redBot: Bot<Context>;
24
+ telegramBot: Bot<Context>;
24
25
  constructor(ctx: Context, config: ComRegister.Config);
25
26
  dynamicDetect(ctx: Context, bot: Bot<Context>, uid: string, guildId: Array<string>): () => Promise<void>;
26
27
  sendMsg(targets: Array<string>, bot: Bot<Context>, content: any): Promise<void>;
@@ -29,6 +29,8 @@ class ComRegister {
29
29
  oneBot;
30
30
  // Red机器人
31
31
  redBot;
32
+ // Telegram机器人
33
+ telegramBot;
32
34
  constructor(ctx, config) {
33
35
  this.logger = ctx.logger('commandRegister');
34
36
  this.config = config;
@@ -44,7 +46,12 @@ class ComRegister {
44
46
  case 'onebot':
45
47
  this.oneBot = bot;
46
48
  break;
47
- case 'red': this.redBot = bot;
49
+ case 'red':
50
+ this.redBot = bot;
51
+ break;
52
+ case 'telegram':
53
+ this.telegramBot = bot;
54
+ break;
48
55
  }
49
56
  });
50
57
  // 从数据库获取订阅
@@ -297,6 +304,7 @@ class ComRegister {
297
304
  switch (session.event.platform) {
298
305
  case 'red':
299
306
  case 'onebot':
307
+ case 'telegram':
300
308
  case 'qq':
301
309
  case 'qqguild': break;
302
310
  default: return '暂不支持该平台';
@@ -497,6 +505,9 @@ class ComRegister {
497
505
  case 'red':
498
506
  bot = this.redBot;
499
507
  break;
508
+ case 'telegram':
509
+ bot = this.telegramBot;
510
+ break;
500
511
  default: return '非法调用';
501
512
  }
502
513
  // 开始循环检测
@@ -538,6 +549,9 @@ class ComRegister {
538
549
  case 'red':
539
550
  bot = this.redBot;
540
551
  break;
552
+ case 'telegram':
553
+ bot = this.telegramBot;
554
+ break;
541
555
  default: return '非法调用';
542
556
  }
543
557
  // 开始循环检测
@@ -930,20 +944,15 @@ class ComRegister {
930
944
  }
931
945
  async getSubFromDatabase(ctx) {
932
946
  // 如果未登录,则直接返回
933
- this.logger.info('Login info:', await this.checkIfIsLogin(ctx));
934
947
  if (!(await this.checkIfIsLogin(ctx)))
935
948
  return;
936
949
  // 已存在订阅管理对象,不再进行订阅操作
937
- this.logger.info('Sub Manager num:', this.subManager.length);
938
950
  if (this.subManager.length !== 0)
939
951
  return;
940
952
  // 从数据库中获取数据
941
953
  const subData = await ctx.database.get('bilibili', { id: { $gt: 0 } });
942
- this.logger.info('Sub object:');
943
- this.logger.info(subData);
944
954
  // 设定订阅数量
945
955
  this.num = subData.length;
946
- this.logger.info('Sub number:' + this.num);
947
956
  // 如果订阅数量超过三个则数据库被非法修改
948
957
  if (!this.config.unlockSubLimits && this.num > 3) {
949
958
  // 在控制台提示重新订阅
@@ -955,8 +964,6 @@ class ComRegister {
955
964
  }
956
965
  // 循环遍历
957
966
  for (const sub of subData) {
958
- this.logger.info('Single sub obj:');
959
- this.logger.info(sub);
960
967
  // 定义Bot
961
968
  let bot;
962
969
  // 判断是否存在没有任何订阅的数据
@@ -980,6 +987,9 @@ class ComRegister {
980
987
  case 'red':
981
988
  bot = this.redBot;
982
989
  break;
990
+ case 'telegram':
991
+ bot = this.telegramBot;
992
+ break;
983
993
  default: {
984
994
  // 本条数据被篡改,删除该条订阅
985
995
  ctx.database.remove('bilibili', { id: sub.id });
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": "1.2.0-rc.0",
4
+ "version": "1.2.0-rc.1",
5
5
  "contributors": [
6
6
  "Akokko <admin@akokko.com>"
7
7
  ],
package/readme.md CHANGED
@@ -1,4 +1,4 @@
1
- # Bilibili-Botify
1
+ # Bilibili-Notify
2
2
 
3
3
  基于 [koishi](../../../../koishijs/koishi) 框架的B站推送插件
4
4
 
@@ -10,6 +10,7 @@
10
10
  - [使用方法](#使用方法)
11
11
  - [注意事项](#注意事项)
12
12
  - [更新日志](#更新日志)
13
+ - [交流群](#交流群)
13
14
  - [感谢](#感谢)
14
15
  - [License](#License)
15
16
 
@@ -106,7 +107,11 @@
106
107
  - ver 1.2.0-alpha.3 修复了指定QQ群订阅时的一个bug
107
108
  - ver 1.2.0-alpha.4 对时间获取进行了优化,能够适应不同环境下的时间获取,修复了一些bug
108
109
  - ver 1.2.0-alpha.5 修复了与PostgreSQL不兼容的问题,优化了图片推送,增强了推送容错
109
- - ver 1.2.0-rc.0 现在可以自定义开播和下播提示语了(实验性)
110
+ - ver 1.2.0-rc.0 现已支持自定义开播和下播提示语(实验性)
111
+ - ver 1.2.0-rc.1 现已支持Telegram平台(实验性)
112
+
113
+ ## 交流群
114
+ 801338523 使用问题或bug都可以在群里提出
110
115
 
111
116
  ## 感谢
112
117