koishi-plugin-bilibili-notify 1.0.4-alpha.0 → 1.0.4-alpha.2

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.
@@ -57,9 +57,8 @@ class ComRegister {
57
57
  .subcommand('.time')
58
58
  .usage('测试时间接口')
59
59
  .example('test.time')
60
- .action(async () => {
61
- const content = await ctx.biliAPI.getTimeNow();
62
- console.log(content);
60
+ .action(async ({ session }) => {
61
+ session.send(await ctx.biliAPI.getTimeNow());
63
62
  });
64
63
  ctx.command('test')
65
64
  .subcommand('.exist')
@@ -102,8 +101,8 @@ class ComRegister {
102
101
  .subcommand('.utc')
103
102
  .usage('获取当前UTC+8 Unix时间戳')
104
103
  .example('test utc')
105
- .action(async () => {
106
- console.log(await ctx.biliAPI.getServerUTCTime());
104
+ .action(async ({ session }) => {
105
+ session.send((await ctx.biliAPI.getServerUTCTime()).toString());
107
106
  });
108
107
  ctx.command('bili', 'bili-notify插件相关指令', { permissions: ['authority:3'] })
109
108
  .subcommand('.login', '登录B站之后才可以进行之后的操作')
@@ -497,13 +496,13 @@ class ComRegister {
497
496
  let firstSubscription = true;
498
497
  let timePoint;
499
498
  // Test code
500
- // let timer = 0
499
+ let timer = 0;
501
500
  return async () => {
502
501
  // Test code
503
- /* console.log('timer:' + timer++);
504
- console.log('firstSubscription:' + firstSubscription);
505
- console.log(`timePoint: ${timePoint}`);
506
- console.log(`timePoint: ${ctx.gimg.unixTimestampToString(timePoint)}`); */
502
+ this.logger.info('timer:' + timer++);
503
+ this.logger.info('firstSubscription:' + firstSubscription);
504
+ this.logger.info(`timePoint: ${timePoint}`);
505
+ this.logger.info(`timePoint: ${ctx.gimg.unixTimestampToString(timePoint)}`);
507
506
  // 第一次订阅判断
508
507
  if (firstSubscription) {
509
508
  // 设置第一次的时间点
@@ -536,13 +535,14 @@ class ComRegister {
536
535
  }
537
536
  // 获取数据内容
538
537
  const items = content.data.items;
539
- // 发送请求 默认只查看前五条数据
538
+ // 发送请求 默认只查看配置文件规定的数据
540
539
  for (let num = this.config.dynamicCheckNumber - 1; num >= 0; num--) {
541
540
  // 没有动态内容则直接跳过
542
541
  if (!items[num])
543
542
  continue;
544
543
  // Test code
545
- // console.log(`items[${num}].modules.module_author.pub_ts: ${ctx.gimg.unixTimestampToString(items[num].modules.module_author.pub_ts)}`);
544
+ this.logger.info(`items[${num}].modules.module_author.pub_ts: ${items[num].modules.module_author.pub_ts}`);
545
+ this.logger.info(`items[${num}].modules.module_author.pub_ts: ${ctx.gimg.unixTimestampToString(items[num].modules.module_author.pub_ts)}`);
546
546
  // 寻找发布时间比时间点时间更晚的动态
547
547
  if (items[num].modules.module_author.pub_ts > timePoint) {
548
548
  // 如果这是遍历的最后一条,将时间点设置为这条动态的发布时间
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.0.4-alpha.0",
4
+ "version": "1.0.4-alpha.2",
5
5
  "contributors": [
6
6
  "Akokko <admin@akokko.com>"
7
7
  ],
package/readme.md CHANGED
@@ -1,6 +1,4 @@
1
- <center>
2
1
  # Bilibili-Botify
3
- </center>
4
2
 
5
3
  基于 [koishi](../../../../koishijs/koishi) 框架的B站推送插件
6
4