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.
@@ -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<void>;
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>;
@@ -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
- targets.push(guild);
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 targets) {
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-bilibili-notify",
3
3
  "description": "Koishi bilibili notify plugin",
4
- "version": "1.2.3-rc.0",
4
+ "version": "1.2.3-rc.1",
5
5
  "contributors": [
6
6
  "Akokko <admin@akokko.com>"
7
7
  ],
package/readme.md CHANGED
@@ -125,6 +125,7 @@
125
125
  - ver 1.2.3-beta.1 新增指令 `bili private` 方便测试主人账号功能
126
126
  - ver 1.2.3-beta.2 功能测试版本,请跳过该版本
127
127
  - ver 1.2.3-rc.0 现已支持向机器人加入的所有群发送推送消息(仅支持Q群,实验性),修复预约动态无法正常推送的bug
128
+ - ver 1.2.3-rc.1 修复 `1.2.3-rc.0` 出现的重复推送bug
128
129
 
129
130
  ## 交流群
130
131