koishi-plugin-bilibili-notify 1.2.3-rc.0 → 1.2.3-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.
- package/lib/comRegister.d.ts +1 -1
- package/lib/comRegister.js +12 -7
- package/package.json +1 -1
- package/readme.md +1 -0
package/lib/comRegister.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ declare class ComRegister {
|
|
|
29
29
|
sendPrivateMsg(bot: Bot<Context>, content: string): Promise<void>;
|
|
30
30
|
sendPrivateMsgAndRebootService(bot: Bot<Context>, ctx: Context, content: string): Promise<void>;
|
|
31
31
|
dynamicDetect(ctx: Context, bot: Bot<Context>, uid: string, guildId: Array<string>): () => Promise<void>;
|
|
32
|
-
sendMsg(targets: Array<string>, bot: Bot<Context>, content: any): Promise<
|
|
32
|
+
sendMsg(targets: Array<string>, bot: Bot<Context>, content: any): Promise<string[]>;
|
|
33
33
|
liveDetect(ctx: Context, bot: Bot<Context>, roomId: string, guildId: Array<string>): () => Promise<void>;
|
|
34
34
|
subShow(): string;
|
|
35
35
|
checkIfNeedSub(comNeed: boolean, subType: string, session: Session, data?: any): Promise<boolean>;
|
package/lib/comRegister.js
CHANGED
|
@@ -896,21 +896,26 @@ class ComRegister {
|
|
|
896
896
|
};
|
|
897
897
|
}
|
|
898
898
|
async sendMsg(targets, bot, content) {
|
|
899
|
-
//
|
|
899
|
+
// 定义需要发送的数组
|
|
900
|
+
let sendArr = [];
|
|
901
|
+
// 判断是否需要推送所有机器人加入的群
|
|
900
902
|
if (targets[0] === 'ALL') {
|
|
901
|
-
// 把All弹出
|
|
902
|
-
targets.pop();
|
|
903
903
|
// 获取所有guild
|
|
904
|
-
for (let guild in await bot.getGuildList())
|
|
905
|
-
|
|
904
|
+
for (let guild in (await bot.getGuildList())) {
|
|
905
|
+
this.logger.info(`已加入${guild}`);
|
|
906
|
+
sendArr.push(guild);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
else {
|
|
910
|
+
sendArr = targets;
|
|
906
911
|
}
|
|
907
912
|
// 循环给每个群组发送
|
|
908
|
-
for (let guildId of
|
|
913
|
+
for (let guildId of sendArr) {
|
|
909
914
|
// 多次尝试生成图片
|
|
910
915
|
let attempts = 3;
|
|
911
916
|
for (let i = 0; i < attempts; i++) {
|
|
912
917
|
try {
|
|
913
|
-
await bot.sendMessage(guildId, content);
|
|
918
|
+
return await bot.sendMessage(guildId, content);
|
|
914
919
|
}
|
|
915
920
|
catch (e) {
|
|
916
921
|
if (i === attempts - 1) { // 已尝试三次
|
package/package.json
CHANGED