koishi-plugin-bilibili-notify 1.2.3-rc.1 → 1.2.3-rc.3
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 +37 -4
- package/package.json +1 -1
- package/readme.md +2 -0
package/lib/comRegister.js
CHANGED
|
@@ -730,7 +730,7 @@ class ComRegister {
|
|
|
730
730
|
await this.sendPrivateMsgAndRebootService(bot, ctx, '测试biliAPI等服务自动重启功能');
|
|
731
731
|
});
|
|
732
732
|
biliCom
|
|
733
|
-
.subcommand('.sendall', '测试给机器人加入的所有群发送消息')
|
|
733
|
+
.subcommand('.sendall', '测试给机器人加入的所有群发送消息', { hidden: true })
|
|
734
734
|
.usage('测试给机器人加入的所有群发送消息')
|
|
735
735
|
.example('bili sendall 测试给机器人加入的所有群发送消息')
|
|
736
736
|
.action(async ({ session }) => {
|
|
@@ -765,6 +765,40 @@ class ComRegister {
|
|
|
765
765
|
await this.sendMsg(['ALL'], bot, 'Hello World');
|
|
766
766
|
await session.send('已向机器人加入的所有群发送了消息');
|
|
767
767
|
});
|
|
768
|
+
biliCom
|
|
769
|
+
.subcommand('.list', '获取机器人加入的所有群组', { hidden: true })
|
|
770
|
+
.usage('获取当前机器人加入的所有群聊')
|
|
771
|
+
.example('bili list 获取当前机器人加入的所有群聊')
|
|
772
|
+
.action(async ({ session }) => {
|
|
773
|
+
let bot;
|
|
774
|
+
switch (session.event.platform) {
|
|
775
|
+
case 'qq':
|
|
776
|
+
bot = this.qqBot;
|
|
777
|
+
break;
|
|
778
|
+
case 'qqguild':
|
|
779
|
+
bot = this.qqguildBot;
|
|
780
|
+
break;
|
|
781
|
+
case 'onebot':
|
|
782
|
+
bot = this.oneBot;
|
|
783
|
+
break;
|
|
784
|
+
case 'red':
|
|
785
|
+
bot = this.redBot;
|
|
786
|
+
break;
|
|
787
|
+
case 'telegram':
|
|
788
|
+
bot = this.telegramBot;
|
|
789
|
+
break;
|
|
790
|
+
case 'satori':
|
|
791
|
+
bot = this.satoriBot;
|
|
792
|
+
break;
|
|
793
|
+
case 'chronocat':
|
|
794
|
+
bot = this.chronocatBot;
|
|
795
|
+
break;
|
|
796
|
+
default: {
|
|
797
|
+
return `暂不支持该平台`;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
(await bot.getGuildList()).data.map(item => this.logger.info(`已加入${item.id}`));
|
|
801
|
+
});
|
|
768
802
|
}
|
|
769
803
|
async sendPrivateMsg(bot, content) {
|
|
770
804
|
if (this.config.master.enable) {
|
|
@@ -901,9 +935,8 @@ class ComRegister {
|
|
|
901
935
|
// 判断是否需要推送所有机器人加入的群
|
|
902
936
|
if (targets[0] === 'ALL') {
|
|
903
937
|
// 获取所有guild
|
|
904
|
-
for (let guild
|
|
905
|
-
|
|
906
|
-
sendArr.push(guild);
|
|
938
|
+
for (let guild of (await bot.getGuildList()).data) {
|
|
939
|
+
sendArr.push(guild.id);
|
|
907
940
|
}
|
|
908
941
|
}
|
|
909
942
|
else {
|
package/package.json
CHANGED
package/readme.md
CHANGED