koishi-plugin-bilibili-notify 1.2.3-rc.0 → 1.2.3-rc.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.
@@ -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>;
@@ -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 }) => {
@@ -896,21 +896,25 @@ 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()).data) {
905
+ sendArr.push(guild);
906
+ }
907
+ }
908
+ else {
909
+ sendArr = targets;
906
910
  }
907
911
  // 循环给每个群组发送
908
- for (let guildId of targets) {
912
+ for (let guildId of sendArr) {
909
913
  // 多次尝试生成图片
910
914
  let attempts = 3;
911
915
  for (let i = 0; i < attempts; i++) {
912
916
  try {
913
- await bot.sendMessage(guildId, content);
917
+ return await bot.sendMessage(guildId, content);
914
918
  }
915
919
  catch (e) {
916
920
  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.2",
5
5
  "contributors": [
6
6
  "Akokko <admin@akokko.com>"
7
7
  ],
package/readme.md CHANGED
@@ -125,6 +125,8 @@
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
129
+ - ver 1.2.3-rc.2 修复推送所有群失败的bug
128
130
 
129
131
  ## 交流群
130
132