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.
- package/lib/comRegister.js +12 -12
- package/package.json +1 -1
- package/readme.md +0 -2
package/lib/comRegister.js
CHANGED
|
@@ -57,9 +57,8 @@ class ComRegister {
|
|
|
57
57
|
.subcommand('.time')
|
|
58
58
|
.usage('测试时间接口')
|
|
59
59
|
.example('test.time')
|
|
60
|
-
.action(async () => {
|
|
61
|
-
|
|
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
|
-
|
|
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
|
-
|
|
499
|
+
let timer = 0;
|
|
501
500
|
return async () => {
|
|
502
501
|
// Test code
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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
|
-
|
|
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