koishi-plugin-bilibili-notify 1.3.7 → 2.0.0-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/database.d.ts CHANGED
@@ -20,6 +20,7 @@ export interface LoginBili {
20
20
  id: number;
21
21
  bili_cookies: string;
22
22
  bili_refresh_token: string;
23
+ dynamic_group_id: string;
23
24
  }
24
25
  export declare const name = "Database";
25
26
  export declare function apply(ctx: Context): void;
package/lib/database.js CHANGED
@@ -4,12 +4,6 @@ exports.name = void 0;
4
4
  exports.apply = apply;
5
5
  exports.name = 'Database';
6
6
  function apply(ctx) {
7
- // 新增LoginBili表
8
- ctx.model.extend('loginBili', {
9
- id: 'unsigned',
10
- bili_cookies: 'text',
11
- bili_refresh_token: 'text'
12
- });
13
7
  // 新增Bilibili表
14
8
  ctx.model.extend('bilibili', {
15
9
  id: 'unsigned',
@@ -22,4 +16,11 @@ function apply(ctx) {
22
16
  platform: 'string',
23
17
  time: 'timestamp'
24
18
  }, { autoInc: true });
19
+ // 新增LoginBili表
20
+ ctx.model.extend('loginBili', {
21
+ id: 'unsigned',
22
+ bili_cookies: 'text',
23
+ bili_refresh_token: 'text',
24
+ dynamic_group_id: 'string'
25
+ });
25
26
  }
@@ -9,14 +9,14 @@ declare class GenerateImg extends Service {
9
9
  giConfig: GenerateImg.Config;
10
10
  constructor(ctx: Context, config: GenerateImg.Config);
11
11
  generateLiveImg(data: any, username: string, userface: string, liveStatus: number): Promise<{
12
- buffer: Buffer;
12
+ buffer: Buffer<ArrayBufferLike>;
13
13
  pic?: undefined;
14
14
  } | {
15
15
  pic: string;
16
16
  buffer?: undefined;
17
17
  }>;
18
18
  generateDynamicImg(data: any): Promise<{
19
- buffer: Buffer;
19
+ buffer: Buffer<ArrayBufferLike>;
20
20
  link: string;
21
21
  pic?: undefined;
22
22
  } | {
package/lib/index.d.ts CHANGED
@@ -9,6 +9,7 @@ declare module 'koishi' {
9
9
  export interface Config {
10
10
  require: {};
11
11
  key: string;
12
+ platform: 'qq' | 'qqguild' | 'onebot' | 'red' | 'telegram' | 'satori' | 'chronocat' | 'lark';
12
13
  master: {};
13
14
  basicSettings: {};
14
15
  unlockSubLimits: boolean;
@@ -18,7 +19,7 @@ export interface Config {
18
19
  dynamic: {};
19
20
  dynamicUrl: boolean;
20
21
  dynamicCheckNumber: number;
21
- dynamicLoopTime: '1分钟' | '2分钟' | '3分钟' | '5分钟' | '20分钟';
22
+ dynamicLoopTime: '1分钟' | '2分钟' | '3分钟' | '5分钟' | '10分钟' | '20分钟';
22
23
  live: {};
23
24
  changeMasterInfoApi: boolean;
24
25
  liveStartAtAll: boolean;
package/lib/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -47,6 +57,10 @@ exports.Config = koishi_1.Schema.object({
47
57
  .role('secret')
48
58
  .required()
49
59
  .description('请输入一个32位小写字母的十六进制密钥(例如:9b8db7ae562b9864efefe06289cc5530),使用此密钥将你的B站登录信息存储在数据库中,请一定保存好此密钥。如果你忘记了此密钥,必须重新登录。你可以自行生成,或到这个网站生成:https://www.sexauth.com/'),
60
+ platform: koishi_1.Schema.union(['qq', 'qqguild', 'onebot', 'red', 'telegram', 'satori', 'chronocat', 'lark'])
61
+ .role('')
62
+ .required()
63
+ .description('请选择你的机器人平台,目前支持QQ、QQ群、OneBot、RedBot、Telegram、Satori、ChronoCat、Lark。从2.0版本开始,只能在一个平台下使用本插件'),
50
64
  master: koishi_1.Schema.intersect([
51
65
  koishi_1.Schema.object({
52
66
  enable: koishi_1.Schema.boolean()
@@ -70,7 +84,7 @@ exports.Config = koishi_1.Schema.object({
70
84
  basicSettings: koishi_1.Schema.object({}).description('基本设置'),
71
85
  unlockSubLimits: koishi_1.Schema.boolean()
72
86
  .default(false)
73
- .description('解锁3个订阅限制,默认只允许订阅3位UP主。订阅过多用户可能有导致IP暂时被封禁的风险'),
87
+ .description('解锁3个直播订阅限制,默认只允许订阅3位UP主。订阅过多用户可能有导致IP暂时被封禁的风险'),
74
88
  automaticResend: koishi_1.Schema.boolean()
75
89
  .default(true)
76
90
  .description('是否开启自动重发功能,默认开启。开启后,如果推送失败,将会自动重发,尝试三次。关闭后,推送失败将不会再重发,直到下一次推送'),
@@ -92,15 +106,14 @@ exports.Config = koishi_1.Schema.object({
92
106
  .step(1)
93
107
  .default(5)
94
108
  .description('设定每次检查动态的数量。若订阅的UP主经常在短时间内连着发多条动态可以将该值提高,若订阅的UP主有置顶动态,在计算该值时应+1。默认值为5条'),
95
- dynamicLoopTime: koishi_1.Schema.union(['1分钟', '2分钟', '3分钟', '5分钟', '20分钟'])
109
+ dynamicLoopTime: koishi_1.Schema.union(['1分钟', '2分钟', '3分钟', '5分钟', '10分钟', '20分钟'])
96
110
  .role('')
97
111
  .default('2分钟')
98
112
  .description('设定多久检测一次动态。若需动态的时效性,可以设置为1分钟。若订阅的UP主经常在短时间内连着发多条动态应该将该值提高,否则会出现动态漏推送和晚推送的问题,默认值为2分钟'),
99
113
  live: koishi_1.Schema.object({}).description('直播推送设置'),
100
114
  changeMasterInfoApi: koishi_1.Schema.boolean()
101
115
  .default(false)
102
- .description('是否切换获取主播信息API,在遇到错误getMasterInfo()时可以尝试切换')
103
- .experimental(),
116
+ .description('是否切换获取主播信息API,在遇到错误getMasterInfo()时可以尝试切换'),
104
117
  liveStartAtAll: koishi_1.Schema.boolean()
105
118
  .default(false)
106
119
  .description('直播开始时艾特全体成员,默认关闭'),
@@ -109,8 +122,7 @@ exports.Config = koishi_1.Schema.object({
109
122
  .description('插件重启后,如果订阅的主播正在直播,是否进行一次推送,默认开启'),
110
123
  pushUrl: koishi_1.Schema.boolean()
111
124
  .default(false)
112
- .description('推送直播状态时是否同时发送链接。注意:如果使用的是QQ官方机器人不能开启此项!')
113
- .experimental(),
125
+ .description('推送直播状态时是否同时发送链接。注意:如果使用的是QQ官方机器人不能开启此项!'),
114
126
  pushTime: koishi_1.Schema.number()
115
127
  .min(0)
116
128
  .max(12)
@@ -125,8 +137,7 @@ exports.Config = koishi_1.Schema.object({
125
137
  .description('自定义下播提示语,-name代表UP昵称,-time代表开播时长。例如-name下播啦,本次直播了-time,会发送为xxxUP下播啦,直播时长为xx小时xx分钟xx秒'),
126
138
  hideDesc: koishi_1.Schema.boolean()
127
139
  .default(false)
128
- .description('是否隐藏UP主直播间简介,开启后推送的直播卡片将不再展示简介')
129
- .experimental(),
140
+ .description('是否隐藏UP主直播间简介,开启后推送的直播卡片将不再展示简介'),
130
141
  style: koishi_1.Schema.object({}).description('美化设置'),
131
142
  removeBorder: koishi_1.Schema.boolean()
132
143
  .default(false)
@@ -243,6 +254,9 @@ class ServerManager extends koishi_1.Service {
243
254
  case '5分钟':
244
255
  this.dynamicLoopTime = 300;
245
256
  break;
257
+ case '10分钟':
258
+ this.dynamicLoopTime = 600;
259
+ break;
246
260
  case '20分钟':
247
261
  this.dynamicLoopTime = 1200;
248
262
  break;
@@ -279,6 +293,7 @@ class ServerManager extends koishi_1.Service {
279
293
  });
280
294
  // CR = ComRegister
281
295
  const cr = this.ctx.plugin(comRegister_1.default, {
296
+ platform: globalConfig.platform,
282
297
  master: globalConfig.master,
283
298
  unlockSubLimits: globalConfig.unlockSubLimits,
284
299
  automaticResend: globalConfig.automaticResend,
@@ -349,7 +364,7 @@ function apply(ctx, config) {
349
364
  globalConfig = config;
350
365
  // 设置提示
351
366
  ctx.notifier.create({
352
- content: '请记得使用Auth插件创建超级管理员账号,没有权限将无法使用该插件提供的指令。'
367
+ content: '请使用Auth插件创建超级管理员账号,没有权限将无法使用该插件提供的指令。'
353
368
  });
354
369
  if (config.unlockSubLimits) { // 用户允许订阅超过三个用户
355
370
  // 设置警告
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.3.7",
4
+ "version": "2.0.0-alpha.1",
5
5
  "contributors": [
6
6
  "Akokko <admin@akokko.com>"
7
7
  ],
@@ -24,11 +24,11 @@
24
24
  "bilibili"
25
25
  ],
26
26
  "peerDependencies": {
27
- "koishi": "^4.17.5"
27
+ "koishi": "^4.18.7"
28
28
  },
29
29
  "dependencies": {
30
- "axios": "^1.7.7",
31
- "axios-cookiejar-support": "^5.0.3",
30
+ "axios": "^1.7.9",
31
+ "axios-cookiejar-support": "^5.0.5",
32
32
  "jimp": "^1.6.0",
33
33
  "jsdom": "^24.1.3",
34
34
  "luxon": "^3.5.0",
@@ -37,15 +37,15 @@
37
37
  "tough-cookie": "^4.1.4"
38
38
  },
39
39
  "devDependencies": {
40
- "@eslint/js": "^9.12.0",
40
+ "@eslint/js": "^9.20.0",
41
41
  "@types/luxon": "^3.4.2",
42
42
  "@types/md5": "^2.3.5",
43
43
  "@types/qrcode": "^1.5.5",
44
44
  "@types/tough-cookie": "^4.0.5",
45
- "eslint": "^9.12.0",
46
- "globals": "^15.11.0",
45
+ "eslint": "^9.20.0",
46
+ "globals": "^15.14.0",
47
47
  "koishi-plugin-puppeteer": "^3.9.0",
48
- "typescript-eslint": "^7.18.0"
48
+ "typescript-eslint": "^7.18.1-alpha.3"
49
49
  },
50
50
  "koishi": {
51
51
  "service": {
package/readme.md CHANGED
@@ -177,6 +177,9 @@
177
177
  - ver 1.3.6 现在基本设置中的userAgent选项为必填项,当因风控订阅失败时会提示更换UA,优化直播人气显示
178
178
  - ver 1.3.7 新增设置项:插件重启后是否进行直播推送。优化直播人气显示
179
179
 
180
+ - ver 2.0.0-alpha.0 重构:对动态订阅进行了重构,优化了订阅流程
181
+ - ver 2.0.0-alpha.1 修复bug:无法成功取消订阅自己、用户没有直播间订阅直播出错。对直播订阅进行了限制,继承自以前的unlockSubLimits配置项。优化了一些配置项
182
+
180
183
  ## 交流群
181
184
 
182
185
  801338523 使用问题或bug都可以在群里提出