@sjtdev/koishi-plugin-dota2tracker 1.1.6-hotfix → 1.1.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/lib/index.js CHANGED
@@ -254,60 +254,60 @@ function PLAYER_INFO_WITH_25_MATCHES(steamAccountId, heroId) {
254
254
  {
255
255
  player(steamAccountId: ${steamAccountId}) {
256
256
  steamAccount {
257
- avatar
258
- name
259
- seasonRank
260
- seasonLeaderboardRank
261
- id
257
+ avatar
258
+ name
259
+ seasonRank
260
+ seasonLeaderboardRank
261
+ id
262
262
  }
263
263
  guildMember {
264
- guild {
265
- tag
266
- }
264
+ guild {
265
+ tag
266
+ }
267
267
  }
268
268
  matchCount
269
269
  winCount
270
270
  performance {
271
- imp
271
+ imp
272
272
  }
273
273
  heroesPerformance(take: 25, request: {matchGroupOrderBy: WIN_COUNT take: 25 ${heroId ? "heroIds:" + heroId : ""}}) {
274
- hero {
275
- id
276
- shortName
277
- }
278
- imp
279
- winCount
280
- matchCount
274
+ hero {
275
+ id
276
+ shortName
277
+ }
278
+ imp
279
+ winCount
280
+ matchCount
281
281
  }
282
282
  matches(request: {take: 25 ${heroId ? "heroIds:" + heroId : ""}}) {
283
- id
284
- rank
285
- lobbyType
286
- gameMode
287
- startDateTime
288
- durationSeconds
289
- didRadiantWin
290
- topLaneOutcome
291
- midLaneOutcome
292
- bottomLaneOutcome
293
- radiantKills
294
- direKills
295
- players(steamAccountId: ${steamAccountId}) {
296
- isRadiant
297
- lane
298
- kills
299
- deaths
300
- assists
301
- position
302
- award
303
- imp
304
- hero {
305
- id
306
- shortName
307
- }
308
- }
309
- }
310
- }
283
+ id
284
+ rank
285
+ lobbyType
286
+ gameMode
287
+ startDateTime
288
+ durationSeconds
289
+ didRadiantWin
290
+ topLaneOutcome
291
+ midLaneOutcome
292
+ bottomLaneOutcome
293
+ radiantKills
294
+ direKills
295
+ players(steamAccountId: ${steamAccountId}) {
296
+ isRadiant
297
+ lane
298
+ kills
299
+ deaths
300
+ assists
301
+ position
302
+ award
303
+ imp
304
+ hero {
305
+ id
306
+ shortName
307
+ }
308
+ }
309
+ }
310
+ }
311
311
 
312
312
  }
313
313
 
@@ -500,6 +500,7 @@ async function testGetHtml(URL) {
500
500
  __name(testGetHtml, "testGetHtml");
501
501
  var ImageType = /* @__PURE__ */ ((ImageType2) => {
502
502
  ImageType2["Icons"] = "icons";
503
+ ImageType2["IconsFacets"] = "icons/facets";
503
504
  ImageType2["Heroes"] = "heroes";
504
505
  ImageType2["HeroIcons"] = "heroes/icons";
505
506
  ImageType2["Items"] = "items";
@@ -1108,7 +1109,7 @@ var ejs = __toESM(require("ejs"));
1108
1109
  var name = "dota2tracker";
1109
1110
  var usage = `
1110
1111
  DOTA2Bot插件-提供自动追踪群友的最新对局的功能(需群友绑定),以及一系列查询功能。
1111
- **更多信息请进入插件主页查看。**`;
1112
+ **更多信息请进入插件主页(github本项目仓库)查看。**`;
1112
1113
  var inject = ["database", "puppeteer", "cron"];
1113
1114
  var Config = import_koishi.Schema.intersect([
1114
1115
  import_koishi.Schema.object({
@@ -1532,7 +1533,6 @@ async function apply(ctx, config) {
1532
1533
  });
1533
1534
  heroes3.push({ id: 0, data: result.remainingContent });
1534
1535
  await ctx.database.upsert("dt_7_36", (row) => heroes3);
1535
- import_fs2.default.writeFileSync("./node_modules/@sjtdev/koishi-plugin-dota2tracker/remainingContent.html", result.remainingContent);
1536
1536
  await session.send("数据获取完成。");
1537
1537
  await page.close();
1538
1538
  }
@@ -1753,7 +1753,7 @@ KDA:${((player.kills + player.assists) / (player.deaths || 1)).toFixed(2)} [${
1753
1753
  broadMatchMessage += broadPlayerMessage + "\n";
1754
1754
  }
1755
1755
  await ctx.broadcast([`${commingGuild.platform}:${commingGuild.guildId}`], broadMatchMessage + img);
1756
- ctx.logger.info(`已解析${match.id}并发布于${commingGuild.platform}:${commingGuild.guildId}。`);
1756
+ ctx.logger.info(`${match.id}${match.parsedDateTime ? "已解析," : "已结束超过1小时仍未被解析,放弃解析直接"}生成图片并发布于${commingGuild.platform}:${commingGuild.guildId}。`);
1757
1757
  }
1758
1758
  if (match.parsedDateTime)
1759
1759
  ctx.database.upsert("dt_previous_query_results", (row) => [{ matchId: match.id, data: match, queryTime: /* @__PURE__ */ new Date() }]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sjtdev/koishi-plugin-dota2tracker",
3
3
  "description": "",
4
- "version": "1.1.6-hotfix",
4
+ "version": "1.1.7",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -385,13 +385,13 @@
385
385
 
386
386
  player.positionPerformance=[];
387
387
  // 瞎j8定义的各位置代表物品,以后看情况调整
388
- const positionItems=["greater_crit","dagon_5","heart","hand_of_midas","ward_observer"];
388
+ const positionIcons = ["damage","nuke","armor","speed","healing"];
389
389
  for (let index = 0; index < 5; index++) {
390
390
  let currentPositionMatches = player.matches.filter(match=>match.players[0].position == ("POSITION_"+(index+1)))
391
391
  let winCount = currentPositionMatches.filter(match=>match.didRadiantWin == match.players[0].isRadiant).length;
392
392
  player.positionPerformance.push({
393
393
  position : (index + 1),
394
- icon : positionItems[index],
394
+ icon : positionIcons[index],
395
395
  matchCount : currentPositionMatches.length,
396
396
  winCount : winCount,
397
397
  loseCount : currentPositionMatches.length - winCount,
@@ -468,7 +468,7 @@
468
468
  <span class="tip lose_count" style="justify-self: start; margin-left: 2px">败场</span>
469
469
  <%- player.positionPerformance
470
470
  .map((position) => `
471
- <span><img src="${utils.getImageUrl(position.icon,ImageType.Items)}"></span>
471
+ <span><img src="${utils.getImageUrl(position.icon,ImageType.IconsFacets)}"></span>
472
472
  <span class="count">${position.matchCount}</span>
473
473
  <span class="win_rate">${position.matchCount>0?(((position.winCount / position.matchCount) * 100).toFixed(0)):"-"}%</span>
474
474
  <span class="imp">${(position.imp > 0 ? "+" : "") + position.imp}</span>