@sjtdev/koishi-plugin-dota2tracker 1.2.7-beta.2 → 1.2.7

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/changelog.md CHANGED
@@ -1,7 +1,28 @@
1
+ ### 1.2.7
2
+ ##### 于1.2.7-beta中尝试修复的功能均已正常工作,正式发布1.2.7
3
+ ##### **新增**:
4
+ - 可在配置页设置查询比赛与发布战报时附带stratz比赛链接、查询玩家信息时附带stratz玩家页面链接、查询英雄数据信息时附带刀塔百科对应英雄页面链接,这些选项均默认关闭。
5
+ ##### **修复**:
6
+ - 修复当同一个steamId在多个已订阅群组中绑定时,仅会向最早绑定的群组发送战报的问题。
7
+ - 现在若所有玩家某项属性都为0时不会错误地将对应称号赋予玩家1,而是取消此称号赋予。(此版本前例如所有玩家治疗量都为0,玩家1会获得“奶”称号,而现在将不会有玩家获得“奶”称号)
8
+ - 修复无法获取群组相关信息导致的日报功能失效。
9
+ - 修复日报功能中统计组合有可能出现重复的问题。
10
+ <details>
11
+ <summary>1.2.7-beta更新日志</summary>
1
12
  ### 1.2.7-beta
2
- **新增**:可在配置页设置发布战报时附带stratz比赛链接、查询玩家信息时附带stratz玩家页面链接,这些选项均默认关闭。
3
- **修复**:(beta测试中) 尝试修复当同一个steamId在多个已订阅群组中绑定时,仅会向最早绑定的群组发送战报的问题。
4
- **修复**:现在若所有玩家某项属性都为0时不会错误地将对应称号赋予玩家1,而是取消此称号赋予。(此版本前例如所有玩家治疗量都为0,玩家1会获得“奶”称号,而现在将不会有玩家获得“奶”称号)
13
+ ##### **新增**:
14
+ - 可在配置页设置发布战报时附带stratz比赛链接、查询玩家信息时附带stratz玩家页面链接,这些选项均默认关闭。
15
+ ##### **修复**:
16
+ - (beta测试中) 尝试修复当同一个steamId在多个已订阅群组中绑定时,仅会向最早绑定的群组发送战报的问题。
17
+ - 现在若所有玩家某项属性都为0时不会错误地将对应称号赋予玩家1,而是取消此称号赋予。(此版本前例如所有玩家治疗量都为0,玩家1会获得“奶”称号,而现在将不会有玩家获得“奶”称号)
18
+
19
+ #### beta.2
20
+ **修复**:尝试修复无法获取群组相关信息导致的日报功能失效。
21
+
22
+ #### beta.3
23
+ **修复**:尝试修复日报功能中统计组合有可能出现重复的问题。
24
+
25
+ </details>
5
26
 
6
27
  ### 1.2.6
7
28
  因koishi更新至4.17.10修复了主动发送消息的函数,本插件的发送消息方式也换回之前的方案以避免可能的代码问题。(功能使用上与1.2.6-pre3版本一致)
package/lib/index.js CHANGED
@@ -1216,7 +1216,11 @@ var Config = import_koishi.Schema.intersect([
1216
1216
  ]),
1217
1217
  import_koishi.Schema.object({
1218
1218
  urlInMessageType: import_koishi.Schema.array(
1219
- import_koishi.Schema.union([import_koishi.Schema.const("match").description("在查询比赛与战报消息中附带stratz比赛链接"), import_koishi.Schema.const("player").description("在查询玩家信息消息中附带stratz玩家链接"), import_koishi.Schema.const("hero").description("---").disabled()])
1219
+ import_koishi.Schema.union([
1220
+ import_koishi.Schema.const("match").description("在查询比赛与战报消息中附带stratz比赛页面链接"),
1221
+ import_koishi.Schema.const("player").description("在查询玩家信息消息中附带stratz玩家页面链接"),
1222
+ import_koishi.Schema.const("hero").description("在查询英雄数据消息中附带刀塔百科对应英雄页面链接")
1223
+ ])
1220
1224
  ).role("checkbox").description("在消息中附带链接,<br/>请选择消息类型:")
1221
1225
  }),
1222
1226
  import_koishi.Schema.object({
@@ -1565,7 +1569,9 @@ async function apply(ctx, config) {
1565
1569
  }
1566
1570
  }
1567
1571
  });
1568
- await session.send(await ctx.puppeteer.render(genImageHTML(hero, config.template_hero, "hero" /* Hero */)));
1572
+ await session.send(
1573
+ (ctx.config.urlInMessageType.some((type) => type == "hero") ? `https://wiki.dota2.com.cn/hero/${hero.shortName}.html` : "") + await ctx.puppeteer.render(genImageHTML(hero, config.template_hero, "hero" /* Hero */))
1574
+ );
1569
1575
  } catch (error) {
1570
1576
  ctx.logger.error(error);
1571
1577
  session.send("获取数据失败");
@@ -1669,7 +1675,7 @@ async function apply(ctx, config) {
1669
1675
  try {
1670
1676
  guildMember = await ctx.bots.find((bot) => bot.platform == subPlayer.platform)?.getGuildMember(subPlayer.guildId, subPlayer.userId);
1671
1677
  } catch (error) {
1672
- ctx.logger.error("获取群组信息失败。Error:" + error);
1678
+ ctx.logger.error("获取群组信息失败。" + error);
1673
1679
  }
1674
1680
  subPlayer.name = subPlayer.nickName || (guildMember?.nick ?? players.find((player2) => player2.steamAccount.id == subPlayer.steamId)?.steamAccount.name);
1675
1681
  player.winCount = player.matches.filter((match) => match.didRadiantWin == match.players.find((innerPlayer) => innerPlayer.steamAccount.id == player.steamAccount.id).isRadiant).length;
@@ -1690,7 +1696,7 @@ async function apply(ctx, config) {
1690
1696
  const currentsubscribedPlayersIds = currentsubscribedPlayers.map((player) => player.steamId);
1691
1697
  const combinationsMap = /* @__PURE__ */ new Map();
1692
1698
  matches.forEach((match) => {
1693
- const sortedPlayerIds = match.players.map((player) => player.steamAccount.id).filter((id) => currentsubscribedPlayersIds.includes(id)).sort((a, b) => a.steamId - b.steamId);
1699
+ const sortedPlayerIds = match.players.map((player) => player.steamAccount.id).filter((id) => currentsubscribedPlayersIds.includes(id)).sort((a, b) => a - b);
1694
1700
  const key = sortedPlayerIds.join(",");
1695
1701
  if (!combinationsMap.has(key)) {
1696
1702
  const players2 = currentsubscribedPlayers.filter((subPlayer) => sortedPlayerIds.includes(subPlayer.steamId));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sjtdev/koishi-plugin-dota2tracker",
3
3
  "description": "koishi插件-追踪群友的DOTA2对局",
4
- "version": "1.2.7-beta.2",
4
+ "version": "1.2.7",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [