@sjtdev/koishi-plugin-dota2tracker 2.3.4 → 2.5.0

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
@@ -5,10 +5,10 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
- var __glob = (map) => (path5) => {
9
- var fn = map[path5];
8
+ var __glob = (map) => (path6) => {
9
+ var fn = map[path6];
10
10
  if (fn) return fn();
11
- throw new Error("Module not found in bundle: " + path5);
11
+ throw new Error("Module not found in bundle: " + path6);
12
12
  };
13
13
  var __commonJS = (cb, mod) => function __require() {
14
14
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
@@ -775,21 +775,21 @@ var require_en_US_command = __commonJS({
775
775
  // src/locales/en-US.schema.yml
776
776
  var require_en_US_schema = __commonJS({
777
777
  "src/locales/en-US.schema.yml"(exports2, module2) {
778
- module2.exports = { _config: { base: { $desc: "Basic Settings", STRATZ_API_TOKEN: "Required. API TOKEN from stratz.com, available at https://stratz.com/api.", dataParsingTimeoutMinutes: "Time to wait for match data parsing (in minutes). If the data parsing time exceeds the waiting time, the report will be generated directly without waiting for the parsing to complete.", proxyAddress: "Proxy address. Leave blank if not using a proxy. \n※Cannot use the global proxy address configured by the `proxy-agent` plugin. This option must be set if you want to use a proxy.", suppressStratzNetworkErrors: "**Please use the `suppressApiNetworkErrors` option below, which applies to both Stratz and OpenDota. \nThis option is still effective. If either this or `suppressApiNetworkErrors` is enabled, Stratz/OpenDota logs will be downgraded to debug output. \nThis option will be removed in a future version.**", suppressApiNetworkErrors: "When enabled, Stratz/OpenDota network error logs will be output at the debug level. \n(e.g., timeouts, network connection issues, but excludes 403 Forbidden) \nKoishi does not display debug-level logs by default. To enable debug log display, please see [📖 Configs#suppressapinetworkerrors](http://sjtdev.github.io/koishi-plugin-dota2tracker/configs.html#suppressapinetworkerrors-boolean)", enableOpenDotaFallback: "Enable OpenDota as a fallback data source for match tracking and query-match features.", OPENDOTA_API_KEY: "Your paid subscription API key for OpenDota. \nSee https://www.opendota.com/api-keys for details. \nFree users should leave this blank.", OpenDotaIPStack: "If you experience frequent failures when accessing the OpenDota API, it might be caused by a faulty IPv6 environment. \nSetting this option will force the use of IPv4 when accessing the OpenDota API to try and resolve the issue." }, message: { $desc: "Message Settings", useHeroNicknames: "When disabled, only the official hero names will be used.", urlInMessageType: { $desc: "Include links in messages, <br/>please select the message type:", $inner: ["Include stratz match page link in match query and report messages", "Include stratz player page link in player information query messages", "Include Dota Encyclopedia hero page link in hero data query messages"] }, rankBroadSwitch: "Rank change broadcast", rankBroadStar: "Star change broadcast", rankBroadLeader: "Leaderboard rank change broadcast", rankBroadFun: "Fun broadcast template", maxSendItemCount: "Maximum number of item images to send<br/>When exceeded, the following option determines whether to send the item list", showItemListAtTooMuchItems: "Send item list when exceeding max count<br/>Controls whether to send the item list image when search results exceed maxSendItemCount", customItemAlias: { $desc: "Custom item aliases<br/>\nAdd additional aliases when built-in list is insufficient. \nFor widely-used missing aliases, please submit issues/pull requests to the source repository.<br/>\n(Example **Keyword**: Blink Dagger,**Alias**: Blink)", keyword: "Keyword", alias: "Alias" }, autoRecallTips: 'Automatically recall tip messages after the command finishes, e.g., "Searching for match details, please wait..."' }, report: { $desc: "Summary Settings", dailyReportSwitch: "Daily Report Function", dailyReportHours: "Daily report time in hours", dailyReportShowCombi: "Show combinations in daily report", weeklyReportSwitch: "Weekly Report Function", weeklyReportDayHours: "Weekly report published on (day) at (hour)", weeklyReportShowCombi: "Show combinations in weekly report" }, template: { $desc: "Template Settings", template_match: "Template used to generate match information images, see [📖 Template Display](https://sjtdev.github.io/koishi-plugin-dota2tracker/template-match.html) for template display.", template_player: "Template used to generate player information images. (Currently only one template available)", template_hero: "Template used to generate hero information images. (Currently only one template available)", playerRankEstimate: "Estimate the rank of players without a rank in the player template <br>Estimated rank will be displayed as a gray image", templateFonts: 'Font names used in the template. Requires font files installed on the koishi host machine. \nMultiple fonts can be added; the system will use the first available font from top to bottom. \nIf all fonts are unavailable, falls back to system defaults. \nImportant formatting rules: \n- Enclose font names in quotes (" ") if they contain spaces or special characters (recommended for all font names)\n- Do NOT enclose generic font family names (e.g. sans-serif, monospace) in quotes\nExamples:\n```\n"Microsoft YaHei"\nsans-serif\n```\nFor details on font-family syntax, see:\n[📖 MDN: font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family)' } } };
778
+ module2.exports = { _config: { base: { $desc: "Basic Settings", STRATZ_API_TOKEN: "Required. API TOKEN from stratz.com, available at https://stratz.com/api.", dataParsingTimeoutMinutes: "Time to wait for match data parsing (in minutes). If the data parsing time exceeds the waiting time, the report will be generated directly without waiting for the parsing to complete.", proxyAddress: "Proxy address. Leave blank if not using a proxy. \n※Cannot use the global proxy address configured by the `proxy-agent` plugin. This option must be set if you want to use a proxy.", suppressStratzNetworkErrors: "**Please use the `suppressApiNetworkErrors` option below, which applies to both Stratz and OpenDota. \nThis option is still effective. If either this or `suppressApiNetworkErrors` is enabled, Stratz/OpenDota logs will be downgraded to debug output. \nThis option will be removed in a future version.**", suppressApiNetworkErrors: "When enabled, Stratz/OpenDota network error logs will be output at the debug level. \n(e.g., timeouts, network connection issues, but excludes 403 Forbidden) \nKoishi does not display debug-level logs by default. To enable debug log display, please see [📖 Configs#suppressapinetworkerrors](https://sjtdev.github.io/koishi-plugin-dota2tracker/en-US/configs.html#suppressapinetworkerrors-boolean)", enableOpenDotaFallback: "Enable OpenDota as a fallback data source for match tracking and query-match features.", OPENDOTA_API_KEY: "Your paid subscription API key for OpenDota. \nSee https://www.opendota.com/api-keys for details. \nFree users should leave this blank.", OpenDotaIPStack: "If you experience frequent failures when accessing the OpenDota API, it might be caused by a faulty IPv6 environment. \nSetting this option will force the use of IPv4 when accessing the OpenDota API to try and resolve the issue." }, message: { $desc: "Message Settings", useHeroNicknames: "When disabled, only the official hero names will be used.", urlInMessageType: { $desc: "Include links in messages, <br/>please select the message type:", $inner: ["Include stratz match page link in match query and report messages", "Include stratz player page link in player information query messages", "Include Dota Encyclopedia hero page link in hero data query messages"] }, rankBroadSwitch: "Rank change broadcast", rankBroadStar: "Star change broadcast", rankBroadLeader: "Leaderboard rank change broadcast", rankBroadFun: "Fun broadcast template", maxSendItemCount: "Maximum number of item images to send<br/>When exceeded, the following option determines whether to send the item list", showItemListAtTooMuchItems: "Send item list when exceeding max count<br/>Controls whether to send the item list image when search results exceed maxSendItemCount", customItemAlias: { $desc: "Custom item aliases<br/>\nAdd additional aliases when built-in list is insufficient. \nFor widely-used missing aliases, please submit issues/pull requests to the source repository.<br/>\n(Example **Keyword**: Blink Dagger,**Alias**: Blink)", keyword: "Keyword", alias: "Alias" }, autoRecallTips: 'Automatically recall tip messages after the command finishes, e.g., "Searching for match details, please wait..."' }, report: { $desc: "Summary Settings", dailyReportSwitch: "Daily Report Function", dailyReportHours: "Daily report time in hours", dailyReportShowCombi: "*Show combinations in daily report*", weeklyReportSwitch: "Weekly Report Function", weeklyReportDayHours: "Weekly report published on (day) at (hour)", weeklyReportShowCombi: "Show combinations in weekly report" }, template: { $desc: "Template Settings", template_match: "Template used for generating match information images. See [📖 Template Info#Match Info Template](https://sjtdev.github.io/koishi-plugin-dota2tracker/en-US/template-match.html) for display effects.", template_player: "Template used for generating player information images. (Currently only one template available)", template_hero: "Template used for generating hero information images. (Currently only one template available)", playerRankEstimate: "Estimate rank for unranked players in the player template <br>Estimated ranks will be displayed as gray images", templateFonts: '**>Deprecated!<** \n**If you need to configure fonts, please use the `fonts.*` configuration option below instead!** \nFont names used in the template. Requires font files to be installed on the device running Koishi. \nMultiple font names can be added, and it will fallback from top to bottom to the first available font; if no fonts are available, the system default font will be used. \nIf a font name contains spaces or special characters, quotes must be added around the name (it is recommended to always use quotes here); \nIf using a generic font family name, you must **NOT use quotes**, e.g.:\n```\n"Microsoft YaHei"\nsans-serif\n```\nFor more information on font-family, please refer to [📖 MDN: font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family)', fontPath: "Font directory path", fonts: { description: "**Interim solution. A more comprehensive and flexible font configuration scheme will be implemented in the console in the future.** \nFont configuration used in the template. \nIt will automatically scan font files in the `fontPath` directory to generate the selectable font list below. \nYou can separately configure fallback lists for sans-serif (sans), serif (serif), and monospace (mono) font families. \nThe main font type used in the templates is **sans-serif**, while some text in certain templates uses **serif** and **monospace** fonts. \nFor more information on font configuration, please refer to [📖 Template Info#Template Fonts](https://sjtdev.github.io/koishi-plugin-dota2tracker/en-US/template-fonts.html)", sans: { $desc: "Sans-serif fonts (sans-serif)" }, serif: { $desc: "Serif fonts (serif)" }, mono: { $desc: "Monospace fonts (monospace)" } } } } };
779
779
  }
780
780
  });
781
781
 
782
782
  // src/locales/en-US.template.yml
783
783
  var require_en_US_template = __commonJS({
784
784
  "src/locales/en-US.template.yml"(exports2, module2) {
785
- module2.exports = { dota2tracker: { template: { radiant: "Radiant", dire: "Dire", won: "Won", lost: "Lost", match_id_: "Match ID: {0}", game_mode_: "Mode: {0}", start_time_: "Start Time: {0}", end_time_: "End Time: {0}", pick_order: "#{0}", random: "R", hero_damage_: "Damage: {0}", building_damage_: "Building: {0}", damage_received_: "Received: {0}", lasthit_: "LastHit: {0}", deny_: "Deny: {0}", "lh/dn_": "LH/DN: {0}", GPM: "GPM", XPM: "XPM", heal_: "Heal: {0}", crowd_control_duration_: "CCD: {0}", "GPM/XPM_": "GPM/XPM: {0}", lane: "Lane", lane_: "Lane: ", lane_advantage: "Lane +", lane_disadvantage: "Lane -", lane_jungle: "Jungle", lane_stomp: "Lane+++", lane_stomped: "Lane---", lane_tie: "Lane ==", analysis_successful: "Analysis successful", analysis_incomplete: "Analysis incomplete", analysis_by_opendota: "Analysis by OpenDota", kill: "Kill", kill_contribution_: "KC: {0}", position: "Position", position_: "Position: ", position_1: "Carry", position_2: "Mid", position_3: "OffLane", position_4: "Softsup", position_5: "Hardsup", dire_won: "Dire Won", radiant_won: "Radiant Won", total_damage: "Damage", total_experience: "Exp.", total_gold: "Gold", region_: "Region: {0}", duration_: "Duration: {0}", position_undefined: "?", top10_: "Top 10 Heroes by Matches: ", match_count_: "Matches: ", last25matches_: "Last 25 Matches: ", winrate_: "Winrate: ", imp_: "IMP: ", lane_advantage_rate_: "Lane Advantage Rate: ", hero: "Hero", all_matches_: "All Matches: ", match_count: "Matches", winrate: "Winrate", imp: "IMP", win_count: "Wins", lose_count: "Losses", recently_heroes: "Heroes used more than once recently: ", recently_positions: "Performance in the last 25 matches across all positions: ", winning_streak: "Winning Streak", losing_streak: "Losing Streak", id: "ID", mode: "Mode", kda_kc: "KDA(KC)", time: "Time", duration: "Duration", rank: "Rank", un_parsed: "(Unparsed)", combined_win_loss_summary: "Combined Win/Loss Summary: ", yesterdays_summary: "Yesterday's Summary", last_weeks_summary: "Last Week's Summary", report_won: "W", report_lost: "L", report_winrate: "WR", anonymous_player_1: "This profile is private.", anonymous_player_2: "Background is for display purposes only. It is not {player}’s data.", rank_fun_down_message: "AVATAR_PLACEHOLDER<br/>Sad", rank_fun_up_message: "Hip hip hooray! Our awesome member AVATAR_PLACEHOLDER{name} has leveled up from PREV_PLACEHOLDER to CURR_PLACEHOLDER!", titles: { MVP: "MVP-#FFA500", Soul: "Soul-#66CCFF", Rich: "R-#FFD700", Wise: "W-#8888FF", Controller: "C-#FF00FF", Nuker: "N-#CC0088", Breaker: "B-#DD0000", Ghost: "G-#CCCCCC", Utility: "U-#20B2AA", Assister: "A-#006400", Demolisher: "D-#FEDCBA", Healer: "H-#00FF00", Tank: "T-#84A1C7", Idle: "I-#DDDDDD" }, situation: "Situation", networth: "Net Worth", experience: "Experience", OUTCOME_MAP: { RADIANT_VICTORY: "RADIANT VICTORY", RADIANT_STOMP: "RADIANT STOMP", DIRE_VICTORY: "DIRE VICTORY", DIRE_STOMP: "DIRE STOMP", TIE: "TIE" }, lane_top: "Top", lane_mid: "Mid", lane_bottom: "Bottom", empty_extra_info: "No extra info", opendota: { networth_unavailable: "Net Worth Chart Unavailable", networth_unavailable_reason: "Data source OpenDota does not provide per-minute net worth data.", lane_outcome_tip: "(Based on gold earned, not net worth; ref only.)", gold_t: "Gold Earned" } } } };
785
+ module2.exports = { dota2tracker: { template: { radiant: "Radiant", dire: "Dire", won: "Won", lost: "Lost", match_id_: "Match ID: {0}", game_mode_: "Mode: {0}", start_time_: "Start Time: {0}", end_time_: "End Time: {0}", pick_order: "#{0}", random: "R", hero_damage_: "Damage: {0}", building_damage_: "Building: {0}", damage_received_: "Received: {0}", lasthit_: "LastHit: {0}", deny_: "Deny: {0}", "lh/dn_": "LH/DN: {0}", GPM: "GPM", XPM: "XPM", heal_: "Heal: {0}", crowd_control_duration_: "CCD: {0}", "GPM/XPM_": "GPM/XPM: {0}", lane: "Lane", lane_: "Lane: ", lane_advantage: "Lane +", lane_disadvantage: "Lane -", lane_jungle: "Jungle", lane_stomp: "Lane+++", lane_stomped: "Lane---", lane_tie: "Lane ==", analysis_successful: "Analysis successful", analysis_incomplete: "Analysis incomplete", analysis_by_opendota: "Analysis by OpenDota", kill: "Kill", kill_contribution_: "KC: {0}", position: "Position", position_: "Position: ", position_1: "Carry", position_2: "Mid", position_3: "OffLane", position_4: "Softsup", position_5: "Hardsup", dire_won: "Dire Won", radiant_won: "Radiant Won", total_damage: "Damage", total_experience: "Exp.", total_gold: "Gold", region_: "Region: {0}", duration_: "Duration: {0}", position_undefined: "?", top10_: "Top 10 Heroes by Matches: ", match_count_: "Matches: ", last25matches_: "Last 25 Matches: ", winrate_: "Winrate: ", imp_: "IMP: ", lane_advantage_rate_: "Lane Advantage Rate: ", hero: "Hero", all_matches_: "All Matches: ", match_count: "Matches", winrate: "Winrate", imp: "IMP", win_count: "Wins", lose_count: "Losses", recently_heroes: "Heroes used more than once recently: ", recently_positions: "Performance in the last 25 matches across all positions: ", winning_streak: "Winning Streak", losing_streak: "Losing Streak", id: "ID", mode: "Mode", kda_kc: "KDA(KC)", time: "Time", duration: "Duration", rank: "Rank", un_parsed: "(Unparsed)", combined_win_loss_summary: "Combined Win/Loss Summary: ", yesterdays_summary: "Yesterday's Summary", last_weeks_summary: "Last Week's Summary", report_won: "W", report_lost: "L", report_winrate: "WR", anonymous_player_1: "This profile is private.", anonymous_player_2: "Background is for display purposes only. It is not {player}’s data.", rank_fun_down_message: "AVATAR_PLACEHOLDER<br/>Sad", rank_fun_up_message: "Hip hip hooray! Our awesome member AVATAR_PLACEHOLDER{name} has leveled up from PREV_PLACEHOLDER to CURR_PLACEHOLDER!", titles: { MVP: "MVP-#FFA500", Soul: "Soul-#66CCFF", Rich: "Rich-#FFD700", Wise: "Wise-#8888FF", Controller: "Controller-#FF00FF", Nuker: "Nuker-#CC0088", Breaker: "Breaker-#DD0000", Ghost: "Ghost-#CCCCCC", Utility: "Utility-#20B2AA", Assister: "Assister-#006400", Demolisher: "Demolisher-#FEDCBA", Healer: "Healer-#00FF00", Tank: "Tank-#84A1C7", Idle: "Idle-#DDDDDD" }, situation: "Situation", networth: "Net Worth", experience: "Experience", OUTCOME_MAP: { RADIANT_VICTORY: "RADIANT VICTORY", RADIANT_STOMP: "RADIANT STOMP", DIRE_VICTORY: "DIRE VICTORY", DIRE_STOMP: "DIRE STOMP", TIE: "TIE" }, lane_top: "Top", lane_mid: "Mid", lane_bottom: "Bottom", empty_extra_info: "No extra info", opendota: { networth_unavailable: "Net Worth Chart Unavailable", networth_unavailable_reason: "Data source OpenDota does not provide per-minute net worth data.", lane_outcome_tip: "(Based on gold earned, not net worth; ref only.)", gold_t: "Gold Earned" }, report: { daily: { plugin_name: "Koishi Dota 2 Plugin", title: "Daily Group Recap", meta: { date_format: "cccc, LLLL d, yyyy", summary: "Performance summary for {0}. High-density battle report generated automatically.", footer_format: "ID: #{0} • Server: {1}" }, stats: { matches: "Matches", win_rate: "Win Rate", kills: "Total Kills", duration: "Duration", avg_time: "Avg", matches_subtext: "%s W - %s L", vs_yesterday: "vs Yesterday", kills_avg: "Avg {0}" }, spotlight: { mvp_title: "The King", lvp_title: "The Suspect", score_label: "MVP Score" }, squad: { title: "Performance", subtitle: "Ranked by KDA (desc)", header: { rank: "Rank", player_info: "Player Info", hero_pool: "Hero Pool (Sorted by Wins)", kda: "KDA Ratio", impact: "Impact" }, impact: { dmg: "Dmg", gold: "Gold" } }, footer: { generated_by: "Generated by Koishi Bot" } } } } } };
786
786
  }
787
787
  });
788
788
 
789
789
  // src/locales/en-US.yml
790
790
  var require_en_US = __commonJS({
791
791
  "src/locales/en-US.yml"(exports2, module2) {
792
- module2.exports = { dota2tracker: { heroes_nicknames: { "0": 'Please strictly follow the format of "", "" when filling out, if the format is incorrect, only the default name of the hero will be used. The default name of the hero may be omitted.', "1": '"Anti-Mage"', "2": '"Axe"', "3": '"Bane"', "4": '"Bloodseeker"', "5": '"Crystal Maiden"', "6": '"Drow Ranger"', "7": '"Earthshaker"', "8": '"Juggernaut"', "9": '"Mirana"', "10": '"Morphling"', "11": '"Shadow Fiend"', "12": '"Phantom Lancer"', "13": '"Puck"', "14": '"Pudge"', "15": '"Razor"', "16": '"Sand King"', "17": '"Storm Spirit"', "18": '"Sven"', "19": '"Tiny"', "20": '"Vengeful Spirit"', "21": '"Windranger"', "22": '"Zeus"', "23": '"Kunkka"', "25": '"Lina"', "26": '"Lion"', "27": '"Shadow Shaman"', "28": '"Slardar"', "29": '"Tidehunter"', "30": '"Witch Doctor"', "31": '"Lich"', "32": '"Riki"', "33": '"Enigma"', "34": '"Tinker"', "35": '"Sniper"', "36": '"Necrophos"', "37": '"Warlock"', "38": '"Beastmaster"', "39": '"Queen of Pain"', "40": '"Venomancer"', "41": '"Faceless Void"', "42": '"Wraith King"', "43": '"Death Prophet"', "44": '"Phantom Assassin"', "45": '"Pugna"', "46": '"Templar Assassin"', "47": '"Viper"', "48": '"Luna"', "49": '"Dragon Knight"', "50": '"Dazzle"', "51": '"Clockwerk"', "52": '"Leshrac"', "53": `"Nature's Prophet"`, "54": '"Lifestealer"', "55": '"Dark Seer"', "56": '"Clinkz"', "57": '"Omniknight"', "58": '"Enchantress"', "59": '"Huskar"', "60": '"Night Stalker"', "61": '"Broodmother"', "62": '"Bounty Hunter"', "63": '"Weaver"', "64": '"Jakiro"', "65": '"Batrider"', "66": '"Chen"', "67": '"Spectre"', "68": '"Ancient Apparition"', "69": '"Doom"', "70": '"Ursa"', "71": '"Spirit Breaker"', "72": '"Gyrocopter"', "73": '"Alchemist"', "74": '"Invoker"', "75": '"Silencer"', "76": '"Outworld Devourer"', "77": '"Lycan"', "78": '"Brewmaster"', "79": '"Shadow Demon"', "80": '"Lone Druid"', "81": '"Chaos Knight"', "82": '"Meepo"', "83": '"Treant Protector"', "84": '"Ogre Magi"', "85": '"Undying"', "86": '"Rubick"', "87": '"Disruptor"', "88": '"Nyx Assassin"', "89": '"Naga Siren"', "90": '"Keeper of the Light"', "91": '"Io"', "92": '"Visage"', "93": '"Slark"', "94": '"Medusa"', "95": '"Troll Warlord"', "96": '"Centaur Warrunner"', "97": '"Magnus"', "98": '"Timbersaw"', "99": '"Bristleback"', "100": '"Tusk"', "101": '"Skywrath Mage"', "102": '"Abaddon"', "103": '"Elder Titan"', "104": '"Legion Commander"', "105": '"Techies"', "106": '"Ember Spirit"', "107": '"Earth Spirit"', "108": '"Underlord"', "109": '"Terrorblade"', "110": '"Phoenix"', "111": '"Oracle"', "112": '"Winter Wyvern"', "113": '"Arc Warden"', "114": '"Monkey King"', "119": '"Dark Willow"', "120": '"Pangolier"', "121": '"Grimstroke"', "123": '"Hoodwink"', "126": '"Void Spirit"', "128": '"Snapfire"', "129": '"Mars"', "131": '"Ring Master"', "135": '"Dawnbreaker"', "136": '"Marci"', "137": '"Primal Beast"', "138": '"Muerta"', "145": '"Kez"', "155": '"Largo"' }, broadcast: { WIN_NEGATIVE: `"Won the match by sheer luck", "Won the match by a stroke of bad luck", "Coasted to victory", "Didn't even show up for the team fight, but my teammates won 4v5"`, WIN_POSITIVE: '"Led the team to victory", "Dominated the opponents and secured the win", "Carried the game to victory", "Treated the opponents like pigs and won", "Won again; this game is just so monotonous and dull", "Simply achieved a win in the match"', LOSE_NEGATIVE: '"Got crushed and lost the match", "Lost the match miserably", "Got my head knocked sideways and lost the match with a blown mindset", "Went fishing but got eaten by the fish, lost the match", "Played terribly", "Simply suffered a loss in the match"', LOSE_POSITIVE: `"Lost the match with no way to turn it around", "Gave it my all, but still lost the match", "Though we lost, we still have honor", "Couldn't carry my teammates, lost the match", "Lost again, it hurts; I'd rather it be me losing"`, message: "{name}'s {hero_name} {comment}.\nKDA: {kda}, GPM/XPM: {gpm_xpm}, Last Hits/Denies: {lh_dn}, Damage/Tower Damage: {damage}, Kill/Death Contribution Rate: {kc_dc}", rank_changed: "Player {name} rank changed: {prev.medal} {prev.star} → {curr.medal} {curr.star}" }, logger: { fetch_guilds_failed: "Failed to fetch guild information.", match_tracked: "Tracked new match {match.id} from {#each messageToLogger as item}users in guild {item.platform}:{item.guildId} [{#each item.players as player}{player.nickname}({player.steamId}){#if player !== item.players[item.players.length - 1]}, {/if}{/each}]{#if item !== messageToLogger[messageToLogger.length - 1]}, {/if}{/each}.", parse_request_sent: "The parsing request for match {matchId} has been successfully sent to the STRATZ server.", parse_request_failed: "The parsing request for match {matchId} failed to send.", match_parsed: "Match {matchId} has been parsed{#if odParsed} by OpenDota{/if}, an image was generated and published to {#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}, {/if}{/each}.", match_unparsed: "Match {matchId} exceeded the waiting time [{timeout}] and remains unparsed, an image was generated and published to {#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}, {/if}{/each}.", waiting_for_parse: "Match {matchId} has not been parsed yet, has been waiting for {time} minutes.", report_sent: "Posted {title} on {platform}:{guildId}.", rank_sent: "Posted rank change information of {player.nickName} ({player.steamId}) on {platform}:{guildId}.", ejs_error: "Error rendering EJS template: {error}", cron_not_enabled: "Cron service is not enabled; match report tracking cannot run.", stratz_token_banned: "Stratz API request rejected (403). This usually means your token or IP has been temporarily restricted due to unusual activity. For details, see the documentation: http://sjtdev.github.io/koishi-plugin-dota2tracker/en-US/api-403.html", opendota_token_banned: "OpenDota API request rejected (403). Please check if the access limit has been exceeded.", stratz_api_query_error: "Stratz API returned partial data with errors: {cause}", opendota_parse_request_sent: "Parse request for match {matchId} has been sent to OpenDota servers successfully.", opendota_parse_request_failed: "Failed to send parse request for match {matchId} to OpenDota servers." }, time: { years_months_ago: "{years} years and {months} months ago", years_ago: "{years} years ago" } } };
792
+ module2.exports = { dota2tracker: { heroes_nicknames: { "0": 'Please strictly follow the format of "", "" when filling out, if the format is incorrect, only the default name of the hero will be used. The default name of the hero may be omitted.', "1": '"Anti-Mage"', "2": '"Axe"', "3": '"Bane"', "4": '"Bloodseeker"', "5": '"Crystal Maiden"', "6": '"Drow Ranger"', "7": '"Earthshaker"', "8": '"Juggernaut"', "9": '"Mirana"', "10": '"Morphling"', "11": '"Shadow Fiend"', "12": '"Phantom Lancer"', "13": '"Puck"', "14": '"Pudge"', "15": '"Razor"', "16": '"Sand King"', "17": '"Storm Spirit"', "18": '"Sven"', "19": '"Tiny"', "20": '"Vengeful Spirit"', "21": '"Windranger"', "22": '"Zeus"', "23": '"Kunkka"', "25": '"Lina"', "26": '"Lion"', "27": '"Shadow Shaman"', "28": '"Slardar"', "29": '"Tidehunter"', "30": '"Witch Doctor"', "31": '"Lich"', "32": '"Riki"', "33": '"Enigma"', "34": '"Tinker"', "35": '"Sniper"', "36": '"Necrophos"', "37": '"Warlock"', "38": '"Beastmaster"', "39": '"Queen of Pain"', "40": '"Venomancer"', "41": '"Faceless Void"', "42": '"Wraith King"', "43": '"Death Prophet"', "44": '"Phantom Assassin"', "45": '"Pugna"', "46": '"Templar Assassin"', "47": '"Viper"', "48": '"Luna"', "49": '"Dragon Knight"', "50": '"Dazzle"', "51": '"Clockwerk"', "52": '"Leshrac"', "53": `"Nature's Prophet"`, "54": '"Lifestealer"', "55": '"Dark Seer"', "56": '"Clinkz"', "57": '"Omniknight"', "58": '"Enchantress"', "59": '"Huskar"', "60": '"Night Stalker"', "61": '"Broodmother"', "62": '"Bounty Hunter"', "63": '"Weaver"', "64": '"Jakiro"', "65": '"Batrider"', "66": '"Chen"', "67": '"Spectre"', "68": '"Ancient Apparition"', "69": '"Doom"', "70": '"Ursa"', "71": '"Spirit Breaker"', "72": '"Gyrocopter"', "73": '"Alchemist"', "74": '"Invoker"', "75": '"Silencer"', "76": '"Outworld Devourer"', "77": '"Lycan"', "78": '"Brewmaster"', "79": '"Shadow Demon"', "80": '"Lone Druid"', "81": '"Chaos Knight"', "82": '"Meepo"', "83": '"Treant Protector"', "84": '"Ogre Magi"', "85": '"Undying"', "86": '"Rubick"', "87": '"Disruptor"', "88": '"Nyx Assassin"', "89": '"Naga Siren"', "90": '"Keeper of the Light"', "91": '"Io"', "92": '"Visage"', "93": '"Slark"', "94": '"Medusa"', "95": '"Troll Warlord"', "96": '"Centaur Warrunner"', "97": '"Magnus"', "98": '"Timbersaw"', "99": '"Bristleback"', "100": '"Tusk"', "101": '"Skywrath Mage"', "102": '"Abaddon"', "103": '"Elder Titan"', "104": '"Legion Commander"', "105": '"Techies"', "106": '"Ember Spirit"', "107": '"Earth Spirit"', "108": '"Underlord"', "109": '"Terrorblade"', "110": '"Phoenix"', "111": '"Oracle"', "112": '"Winter Wyvern"', "113": '"Arc Warden"', "114": '"Monkey King"', "119": '"Dark Willow"', "120": '"Pangolier"', "121": '"Grimstroke"', "123": '"Hoodwink"', "126": '"Void Spirit"', "128": '"Snapfire"', "129": '"Mars"', "131": '"Ring Master"', "135": '"Dawnbreaker"', "136": '"Marci"', "137": '"Primal Beast"', "138": '"Muerta"', "145": '"Kez"', "155": '"Largo"' }, broadcast: { WIN_NEGATIVE: `"Won the match by sheer luck", "Won the match by a stroke of bad luck", "Coasted to victory", "Didn't even show up for the team fight, but my teammates won 4v5"`, WIN_POSITIVE: '"Led the team to victory", "Dominated the opponents and secured the win", "Carried the game to victory", "Treated the opponents like pigs and won", "Won again; this game is just so monotonous and dull", "Simply achieved a win in the match"', LOSE_NEGATIVE: '"Got crushed and lost the match", "Lost the match miserably", "Got my head knocked sideways and lost the match with a blown mindset", "Went fishing but got eaten by the fish, lost the match", "Played terribly", "Simply suffered a loss in the match"', LOSE_POSITIVE: `"Lost the match with no way to turn it around", "Gave it my all, but still lost the match", "Though we lost, we still have honor", "Couldn't carry my teammates, lost the match", "Lost again, it hurts; I'd rather it be me losing"`, message: "{name}'s {hero_name} {comment}.\nKDA: {kda}, GPM/XPM: {gpm_xpm}, Last Hits/Denies: {lh_dn}, Damage/Tower Damage: {damage}, Kill/Death Contribution Rate: {kc_dc}", rank_changed: "Player {name} rank changed: {prev.medal} {prev.star} → {curr.medal} {curr.star}" }, logger: { fetch_guilds_failed: "Failed to fetch guild information.", match_tracked: "Tracked new match {match.id} from {#each messageToLogger as item}users in guild {item.platform}:{item.guildId} [{#each item.players as player}{player.nickname}({player.steamId}){#if player !== item.players[item.players.length - 1]}, {/if}{/each}]{#if item !== messageToLogger[messageToLogger.length - 1]}, {/if}{/each}.", parse_request_sent: "The parsing request for match {matchId} has been successfully sent to the STRATZ server.", parse_request_failed: "The parsing request for match {matchId} failed to send.", match_parsed: "Match {matchId} has been parsed{#if odParsed} by OpenDota{/if}, an image was generated and published to {#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}, {/if}{/each}.", match_unparsed: "Match {matchId} exceeded the waiting time [{timeout}] and remains unparsed, an image was generated and published to {#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}, {/if}{/each}.", waiting_for_parse: "Match {matchId} has not been parsed yet, has been waiting for {time} minutes.", report_sent: "Posted {title} on {platform}:{guildId}.", rank_sent: "Posted rank change information of {player.nickName} ({player.steamId}) on {platform}:{guildId}.", ejs_error: "Error rendering EJS template: {error}", cron_not_enabled: "Cron service is not enabled; match report tracking cannot run.", stratz_token_banned: "Stratz API request rejected (403). This usually means your token or IP has been temporarily restricted due to unusual activity. For details, see the documentation: http://sjtdev.github.io/koishi-plugin-dota2tracker/en-US/api-403.html", opendota_token_banned: "OpenDota API request rejected (403). Please check if the access limit has been exceeded.", stratz_api_query_error: "Stratz API returned partial data with errors: {cause}", opendota_parse_request_sent: "Parse request for match {matchId} has been sent to OpenDota servers successfully.", opendota_parse_request_failed: "Failed to send parse request for match {matchId} to OpenDota servers.", font_loaded: "Font directory changed: {filename} ({eventType}), reloading font list..." }, time: { years_months_ago: "{years} years and {months} months ago", years_ago: "{years} years ago" } } };
793
793
  }
794
794
  });
795
795
 
@@ -803,21 +803,21 @@ var require_zh_CN_command = __commonJS({
803
803
  // src/locales/zh-CN.schema.yml
804
804
  var require_zh_CN_schema = __commonJS({
805
805
  "src/locales/zh-CN.schema.yml"(exports2, module2) {
806
- module2.exports = { _config: { base: { $desc: "基础设置", STRATZ_API_TOKEN: "※必须。stratz.com的API TOKEN,可在 https://stratz.com/api 获取。", dataParsingTimeoutMinutes: "等待比赛数据解析的时间(单位:分钟)。如果数据解析时间超过等待时间,将直接生成战报而不再等待解析完成。", proxyAddress: "代理地址,不使用代理请留空。 \n※无法使用`proxy-agent`插件配置的全局代理地址,欲使用代理必须设置此项。", suppressStratzNetworkErrors: "**请使用下方通用于 stratz 与 opendota 的配置项`suppressApiNetworkErrors`。 \n此配置项仍然生效,当与`suppressApiNetworkErrors`任一启用时将会使 stratz/opendota 日志降级到debug输出。 \n此配置项将于下版本被移除。**", suppressApiNetworkErrors: "开启后将 stratz/opendota 网络错误日志使用debug级别输出。 \n(如超时、网络不通等,但403 Forbidden除外) \nkoishi默认不显示debug级日志,若需要开启debug日志显示,请见 [📖 配置项#suppressapinetworkerrors](http://sjtdev.github.io/koishi-plugin-dota2tracker/configs.html#suppressapinetworkerrors-boolean)", enableOpenDotaFallback: "启用 OpenDota 作为战报追踪与查询比赛功能的备用数据源。", OPENDOTA_API_KEY: "OpenDota 的订阅付费APIKEY, \n可在 https://www.opendota.com/api-keys 查看详情。 \nOpenDota 的免费用户此处请留空。", OpenDotaIPStack: "若访问 OpenDota API 时频繁失败,可能是由于错误的 IPv6 环境导致的。 \n设置此选项可在访问 OpenDota API 时强制使用 IPv4 尝试解决问题。" }, message: { $desc: "消息设置", useHeroNicknames: "是否使用英雄别名。关闭后仅使用英雄正式名称。", urlInMessageType: { $desc: "在消息中附带链接,<br/>请选择消息类型:", $inner: ["在查询比赛与战报消息中附带stratz比赛页面链接", "在查询玩家信息消息中附带stratz玩家页面链接", "在查询英雄数据消息中附带刀塔百科对应英雄页面链接"] }, rankBroadSwitch: "段位变动播报", rankBroadStar: "星级变动播报", rankBroadLeader: "冠绝名次变动播报", rankBroadFun: "整活播报模板", maxSendItemCount: "最大发送物品图片数量,<br/> 当超过指定数量时将由下方选项决定是否发送查询结果的物品列表图片", showItemListAtTooMuchItems: "在查询结果的物品数量超过指定数量时,是否发送查询结果的物品列表图片", customItemAlias: { $desc: "额外物品别名设置<br/>当插件内置的[物品别名列表](https://github.com/sjtdev/koishi-plugin-dota2tracker/blob/master/src/locales/zh-CN.constants.json#L304-L407)中没有想要的物品别名可在此处追加,如果是插件疏漏的广为人知的物品别名推荐到源码仓库提交issue或pull request完善列表。<br/>(例如 **关键词**: 闪烁匕首,**别名**: 跳刀)", keyword: "关键词", alias: "别名" }, autoRecallTips: "在指令调用结束后自动撤回提示消息,如:“正在搜索对局详情,请稍后……”" }, report: { $desc: "总结设置", dailyReportSwitch: "日报功能", dailyReportHours: "日报时间小时", dailyReportShowCombi: "日报是否显示组合", weeklyReportSwitch: "周报功能", weeklyReportDayHours: "周报发布于周(几)的(几)点", weeklyReportShowCombi: "周报是否显示组合" }, template: { $desc: "模板设置", template_match: "生成比赛信息图片使用的模板,显示效果见 [📖 模板展示页](https://sjtdev.github.io/koishi-plugin-dota2tracker/template-match.html)。", template_player: "生成玩家信息图片使用的模板。(目前仅有一张模板)", template_hero: "生成英雄信息图片使用的模板。(目前仅有一张模板)", playerRankEstimate: "在player模板中对没有段位的玩家进行段位估算 <br>估算的段位将以灰色图片显示", templateFonts: '模板所使用的字体名。需要 koishi 所在设备安装字体文件。 \n可添加多个字体名,将从上到下回退到第一个可用字体;若所有字体都不可用,则使用系统默认字体。 \n其中字体名若包含空格或特殊字符需要在名称首尾添加引号(此处建议尽量强制使用引号); \n若使用字体族名则必须**不使用引号**,如:\n```\n"Microsoft YaHei"\nsans-serif\n```\n有关font-family的更多信息,请查阅 [📖 MDN: font-family](https://developer.mozilla.org/zh-CN/docs/Web/CSS/font-family) ' } } };
806
+ module2.exports = { _config: { base: { $desc: "基础设置", STRATZ_API_TOKEN: "※必须。stratz.com的API TOKEN,可在 https://stratz.com/api 获取。", dataParsingTimeoutMinutes: "等待比赛数据解析的时间(单位:分钟)。如果数据解析时间超过等待时间,将直接生成战报而不再等待解析完成。", proxyAddress: "代理地址,不使用代理请留空。 \n※无法使用`proxy-agent`插件配置的全局代理地址,欲使用代理必须设置此项。", suppressStratzNetworkErrors: "**请使用下方通用于 stratz 与 opendota 的配置项`suppressApiNetworkErrors`。 \n此配置项仍然生效,当与`suppressApiNetworkErrors`任一启用时将会使 stratz/opendota 日志降级到debug输出。 \n此配置项将于下版本被移除。**", suppressApiNetworkErrors: "开启后将 stratz/opendota 网络错误日志使用debug级别输出。 \n(如超时、网络不通等,但403 Forbidden除外) \nkoishi默认不显示debug级日志,若需要开启debug日志显示,请见 [📖 配置项#suppressapinetworkerrors](http://sjtdev.github.io/koishi-plugin-dota2tracker/configs.html#suppressapinetworkerrors-boolean)", enableOpenDotaFallback: "启用 OpenDota 作为战报追踪与查询比赛功能的备用数据源。", OPENDOTA_API_KEY: "OpenDota 的订阅付费APIKEY, \n可在 https://www.opendota.com/api-keys 查看详情。 \nOpenDota 的免费用户此处请留空。", OpenDotaIPStack: "若访问 OpenDota API 时频繁失败,可能是由于错误的 IPv6 环境导致的。 \n设置此选项可在访问 OpenDota API 时强制使用 IPv4 尝试解决问题。" }, message: { $desc: "消息设置", useHeroNicknames: "是否使用英雄别名。关闭后仅使用英雄正式名称。", urlInMessageType: { $desc: "在消息中附带链接,<br/>请选择消息类型:", $inner: ["在查询比赛与战报消息中附带stratz比赛页面链接", "在查询玩家信息消息中附带stratz玩家页面链接", "在查询英雄数据消息中附带刀塔百科对应英雄页面链接"] }, rankBroadSwitch: "段位变动播报", rankBroadStar: "星级变动播报", rankBroadLeader: "冠绝名次变动播报", rankBroadFun: "整活播报模板", maxSendItemCount: "最大发送物品图片数量,<br/> 当超过指定数量时将由下方选项决定是否发送查询结果的物品列表图片", showItemListAtTooMuchItems: "在查询结果的物品数量超过指定数量时,是否发送查询结果的物品列表图片", customItemAlias: { $desc: "额外物品别名设置<br/>当插件内置的[物品别名列表](https://github.com/sjtdev/koishi-plugin-dota2tracker/blob/master/src/locales/zh-CN.constants.json#L304-L407)中没有想要的物品别名可在此处追加,如果是插件疏漏的广为人知的物品别名推荐到源码仓库提交issue或pull request完善列表。<br/>(例如 **关键词**: 闪烁匕首,**别名**: 跳刀)", keyword: "关键词", alias: "别名" }, autoRecallTips: "在指令调用结束后自动撤回提示消息,如:“正在搜索对局详情,请稍后……”" }, report: { $desc: "总结设置", dailyReportSwitch: "日报功能", dailyReportHours: "日报时间小时", dailyReportShowCombi: "*日报是否显示组合*", weeklyReportSwitch: "周报功能", weeklyReportDayHours: "周报发布于周(几)的(几)点", weeklyReportShowCombi: "周报是否显示组合" }, template: { $desc: "模板设置", template_match: "生成比赛信息图片使用的模板,显示效果见 [📖 模板相关#对局信息模板](https://sjtdev.github.io/koishi-plugin-dota2tracker/template-match.html)。", template_player: "生成玩家信息图片使用的模板。(目前仅有一张模板)", template_hero: "生成英雄信息图片使用的模板。(目前仅有一张模板)", playerRankEstimate: "在player模板中对没有段位的玩家进行段位估算 <br>估算的段位将以灰色图片显示", templateFonts: '**>已弃用!<** \n**如果需要配置字体请使用下方`fonts.*`配置项代替!** \n模板所使用的字体名。需要 koishi 所在设备安装字体文件。 \n可添加多个字体名,将从上到下回退到第一个可用字体;若所有字体都不可用,则使用系统默认字体。 \n其中字体名若包含空格或特殊字符需要在名称首尾添加引号(此处建议尽量强制使用引号); \n若使用字体族名则必须**不使用引号**,如:\n```\n"Microsoft YaHei"\nsans-serif\n```\n有关font-family的更多信息,请查阅 [📖 MDN: font-family](https://developer.mozilla.org/zh-CN/docs/Web/CSS/font-family)', fontPath: "字体文件文件夹路径", fonts: { description: "**过渡方案,之后会重启控制台页面并在其中实现更完善更灵活的字体配置方案。** \n模板所使用的字体配置。\n会自动读取配置项 `fontPath` 目录下的字体文件为下方配置项生成可选字体列表。 \n可分别配置无衬线(sans)、衬线(serif)、等宽(mono)字体族的备选表。 \n模板的主要使用字体类型为**无衬线字体**,部分模板的一些文本会使用到**衬线字体**及**等宽字体**。 \n关于字体文件配置的更多信息,请查阅 [📖 模板相关#模板字体](https://sjtdev.github.io/koishi-plugin-dota2tracker/template-fonts.html)", sans: { $desc: "无衬线字体(sans-serif)" }, serif: { $desc: "衬线字体(serif)" }, mono: { $desc: "等宽字体(monospace)" } } } } };
807
807
  }
808
808
  });
809
809
 
810
810
  // src/locales/zh-CN.template.yml
811
811
  var require_zh_CN_template = __commonJS({
812
812
  "src/locales/zh-CN.template.yml"(exports2, module2) {
813
- module2.exports = { dota2tracker: { template: { radiant: "天辉", dire: "夜魇", won: "获胜", lost: "失败", match_id_: "比赛编号:{0}", game_mode_: "模式:{0}", start_time_: "起始时间:{0}", end_time_: "结束时间:{0}", pick_order: "第{0}手", random: "随机", hero_damage_: "英雄伤害:{0}", building_damage_: "建筑伤害:{0}", damage_received_: "受到伤害:{0}", lasthit_: "补刀:{0}", deny_: "反补:{0}", "lh/dn_": "补刀:{0}/{1}", GPM: "GPM", XPM: "XPM", heal_: "治疗量:{0}", crowd_control_duration_: "控制时间:{0}", "GPM/XPM_": "GPM/XPM:{0}", lane: "对线", lane_: "对线:", lane_advantage: "对线优势", lane_disadvantage: "对线劣势", lane_stomp: "对线碾压", lane_stomped: "对线被碾", lane_tie: "对线平手", lane_jungle: "野区霸主", analysis_successful: "录像分析成功", analysis_incomplete: "分析结果不完整", analysis_by_opendota: "数据解析自 OpenDota", kill: "击杀", kill_contribution_: "参战率:{0}", position: "位置", position_: "位置:", position_1: "优势路", position_2: "中路", position_3: "烈士路", position_4: "采灵芝", position_5: "工具人", position_undefined: "?", total_damage: "总伤害", total_gold: "总经济", total_experience: "总经验", radiant_won: "天辉获胜", dire_won: "夜魇获胜", duration_: "持续时间:{0}", region_: "地区:{0}", match_count_: "场次:", last25matches_: "最近25场:", winrate_: "胜率:", imp_: "表现:", lane_advantage_rate_: "线优率:", top10_: "全期场次前十的英雄:", hero: "英雄", all_matches_: "全期场次:", match_count: "场次", winrate: "胜率", imp: "表现", win_count: "胜场", lose_count: "败场", recently_heroes: "近期使用场次大于1的英雄:", recently_positions: "近25场各个位置的表现:", winning_streak: "连胜", losing_streak: "连败", id: "ID", mode: "模式", kda_kc: "KDA(参战率)", time: "时间", duration: "时长", rank: "段位", un_parsed: "(未解析)", combined_win_loss_summary: "组合胜负情况:", yesterdays_summary: "昨日总结", last_weeks_summary: "上周总结", report_won: "胜", report_lost: "负", report_winrate: "胜率", anonymous_player_1: "数据未公开", anonymous_player_2: "背景仅供展示目的,不属于{player}的数据。", rank_fun_up_message: "热烈祝贺群友 AVATAR_PLACEHOLDER{name} 在天梯中再获进步,<br/>由 PREV_PLACEHOLDER 升为 CURR_PLACEHOLDER,再接再厉,再创辉煌!", rank_fun_down_message: "AVATAR_PLACEHOLDER<br/>寄", titles: { MVP: "MVP-#FFA500", Soul: "魂-#66CCFF", Rich: "富-#FFD700", Wise: "睿-#8888FF", Controller: "控-#FF00FF", Nuker: "爆-#CC0088", Breaker: "破-#DD0000", Ghost: "鬼-#CCCCCC", Utility: "辅-#20B2AA", Assister: "助-#006400", Demolisher: "拆-#FEDCBA", Healer: "奶-#00FF00", Tank: "耐-#84A1C7", Idle: "摸-#DDDDDD" }, situation: "局势", networth: "经济", experience: "经验", OUTCOME_MAP: { RADIANT_VICTORY: "天辉优势", RADIANT_STOMP: "天辉碾压", DIRE_VICTORY: "夜魇优势", DIRE_STOMP: "夜魇碾压", TIE: "势均力敌" }, lane_top: "上路", lane_mid: "中路", lane_bottom: "下路", empty_extra_info: "比赛未解析或信息缺失,无法展示更多数据。", opendota: { networth_unavailable: "经济走势图不可用", networth_unavailable_reason: "数据源 OpenDota 未提供每分钟经济数据。", lane_outcome_tip: "(数据基于累计获得金币而非经济,仅供参考)", gold_t: "累计获得金币" } } } };
813
+ module2.exports = { dota2tracker: { template: { radiant: "天辉", dire: "夜魇", won: "获胜", lost: "失败", match_id_: "比赛编号:{0}", game_mode_: "模式:{0}", start_time_: "起始时间:{0}", end_time_: "结束时间:{0}", pick_order: "第{0}手", random: "随机", hero_damage_: "英雄伤害:{0}", building_damage_: "建筑伤害:{0}", damage_received_: "受到伤害:{0}", lasthit_: "补刀:{0}", deny_: "反补:{0}", "lh/dn_": "补刀:{0}/{1}", GPM: "GPM", XPM: "XPM", heal_: "治疗量:{0}", crowd_control_duration_: "控制时间:{0}", "GPM/XPM_": "GPM/XPM:{0}", lane: "对线", lane_: "对线:", lane_advantage: "对线优势", lane_disadvantage: "对线劣势", lane_stomp: "对线碾压", lane_stomped: "对线被碾", lane_tie: "对线平手", lane_jungle: "野区霸主", analysis_successful: "录像分析成功", analysis_incomplete: "分析结果不完整", analysis_by_opendota: "数据解析自 OpenDota", kill: "击杀", kill_contribution_: "参战率:{0}", position: "位置", position_: "位置:", position_1: "优势路", position_2: "中路", position_3: "烈士路", position_4: "采灵芝", position_5: "工具人", position_undefined: "?", total_damage: "总伤害", total_gold: "总经济", total_experience: "总经验", radiant_won: "天辉获胜", dire_won: "夜魇获胜", duration_: "持续时间:{0}", region_: "地区:{0}", match_count_: "场次:", last25matches_: "最近25场:", winrate_: "胜率:", imp_: "表现:", lane_advantage_rate_: "线优率:", top10_: "全期场次前十的英雄:", hero: "英雄", all_matches_: "全期场次:", match_count: "场次", winrate: "胜率", imp: "表现", win_count: "胜场", lose_count: "败场", recently_heroes: "近期使用场次大于1的英雄:", recently_positions: "近25场各个位置的表现:", winning_streak: "连胜", losing_streak: "连败", id: "ID", mode: "模式", kda_kc: "KDA(参战率)", time: "时间", duration: "时长", rank: "段位", un_parsed: "(未解析)", combined_win_loss_summary: "组合胜负情况:", yesterdays_summary: "昨日总结", last_weeks_summary: "上周总结", report_won: "胜", report_lost: "负", report_winrate: "胜率", anonymous_player_1: "数据未公开", anonymous_player_2: "背景仅供展示目的,不属于{player}的数据。", rank_fun_up_message: "热烈祝贺群友 AVATAR_PLACEHOLDER{name} 在天梯中再获进步,<br/>由 PREV_PLACEHOLDER 升为 CURR_PLACEHOLDER,再接再厉,再创辉煌!", rank_fun_down_message: "AVATAR_PLACEHOLDER<br/>寄", titles: { MVP: "MVP-#FFA500", Soul: "魂-#66CCFF", Rich: "富-#FFD700", Wise: "睿-#8888FF", Controller: "控-#FF00FF", Nuker: "爆-#CC0088", Breaker: "破-#DD0000", Ghost: "鬼-#CCCCCC", Utility: "辅-#20B2AA", Assister: "助-#006400", Demolisher: "拆-#FEDCBA", Healer: "奶-#00FF00", Tank: "耐-#84A1C7", Idle: "摸-#DDDDDD" }, situation: "局势", networth: "经济", experience: "经验", OUTCOME_MAP: { RADIANT_VICTORY: "天辉优势", RADIANT_STOMP: "天辉碾压", DIRE_VICTORY: "夜魇优势", DIRE_STOMP: "夜魇碾压", TIE: "势均力敌" }, lane_top: "上路", lane_mid: "中路", lane_bottom: "下路", empty_extra_info: "比赛未解析或信息缺失,无法展示更多数据。", opendota: { networth_unavailable: "经济走势图不可用", networth_unavailable_reason: "数据源 OpenDota 未提供每分钟经济数据。", lane_outcome_tip: "(数据基于累计获得金币而非经济,仅供参考)", gold_t: "累计获得金币" }, report: { daily: { plugin_name: "Koishi Dota 2 Plugin", title: "每日战报", meta: { date_format: "yyyy年L月d日 cccc", summary: "战报生成于 {0}。高密度战斗数据自动汇总。", footer_format: "ID: #{0} • 服务器: {1}" }, stats: { matches: "总场次", win_rate: "胜率", kills: "总击杀", duration: "总时长", avg_time: "平均时长", matches_subtext: "{0}胜 - {1}负", vs_yesterday: "较昨日", kills_avg: "场均 {0}" }, spotlight: { mvp_title: "全 场 最 佳", lvp_title: "头 号 战 犯", score_label: "综合评分" }, squad: { title: "表现排行", subtitle: "基于 KDA 倒序排列", header: { rank: "排名", player_info: "玩家", hero_pool: "英雄池(基于胜场)", kda: "KDA", impact: "贡献 / 经济" }, impact: { dmg: "伤害", gold: "经济" } }, footer: { generated_by: "Generated by Koishi Bot" } } } } } };
814
814
  }
815
815
  });
816
816
 
817
817
  // src/locales/zh-CN.yml
818
818
  var require_zh_CN = __commonJS({
819
819
  "src/locales/zh-CN.yml"(exports2, module2) {
820
- module2.exports = { dota2tracker: { heroes_nicknames: { "0": '请严格遵循 "", "" 格式填写(如下方默认数据,注意是英文半角符号),如果格式有误将仅使用英雄默认名称。可以不包含英雄默认名称。', "1": '"敌法师", "敌法", "AM"', "2": '"斧王"', "3": '"祸乱之源", "祸乱", "水桶腰"', "4": '"血魔"', "5": '"水晶室女", "冰女", "CM"', "6": '"卓尔游侠", "小黑"', "7": '"撼地者", "小牛", "牛头"', "8": '"主宰", "剑圣", "jugg", "奶棒人"', "9": '"米拉娜", "白虎", "pom"', "10": '"变体精灵", "水人"', "11": '"影魔", "影魔王", "SF", "影儿魔儿"', "12": '"幻影长矛手", "PL"', "13": '"帕克"', "14": '"帕吉", "屠夫", "扒鸡", "啪唧"', "15": '"雷泽", "电魂", "电棍"', "16": '"沙王", "SK"', "17": '"风暴之灵", "蓝猫"', "18": '"斯温", "流浪剑客", "流浪"', "19": '"小小"', "20": '"复仇之魂", "复仇", "VS"', "21": '"风行者", "风行", "WR"', "22": '"宙斯"', "23": '"昆卡", "船长"', "25": '"莉娜", "火女"', "26": '"莱恩", "恶魔巫师", "Lion"', "27": '"暗影萨满", "小Y", "小歪"', "28": '"斯拉达", "大鱼", "大鱼人"', "29": '"潮汐猎人", "潮汐", "西瓜皮"', "30": '"巫医"', "31": '"巫妖"', "32": '"力丸", "隐形刺客", "隐刺"', "33": '"谜团"', "34": '"修补匠", "TK", "Tinker"', "35": '"狙击手", "矮人火枪手", "火枪", "传说哥"', "36": '"瘟疫法师", "死灵法", "NEC"', "37": '"术士", "Warlock"', "38": '"兽王"', "39": '"痛苦女王", "女王", "QOP"', "40": '"剧毒术士", "剧毒"', "41": '"虚空假面", "虚空", "JB脸"', "42": '"冥魂大帝", "骷髅王"', "43": '"死亡先知", "DP"', "44": '"幻影刺客", "幻刺", "PA"', "45": '"帕格纳", "骨法", "湮灭法师"', "46": '"圣堂刺客", "圣堂", "TA"', "47": '"冥界亚龙", "毒龙", "Viper"', "48": '"露娜", "月骑", "Luna"', "49": '"龙骑士", "龙骑"', "50": '"戴泽", "暗影牧师", "暗牧"', "51": '"发条技师", "发条"', "52": '"拉席克", "老鹿"', "53": '"先知"', "54": '"噬魂鬼", "小狗"', "55": '"黑暗贤者", "黑贤"', "56": '"克林克兹", "小骷髅"', "57": '"全能骑士", "全能"', "58": '"魅惑魔女", "小鹿"', "59": '"哈斯卡", "神灵", "神灵武士"', "60": '"暗夜魔王", "夜魔"', "61": '"育母蜘蛛", "蜘蛛"', "62": '"赏金猎人", "赏金"', "63": '"编织者", "蚂蚁"', "64": '"杰奇洛", "双头龙"', "65": '"蝙蝠骑士", "蝙蝠"', "66": '"陈", "老陈"', "67": '"幽鬼", "SPE", "UG"', "68": '"远古冰魄", "冰魂"', "69": '"末日使者", "末日", "Doom"', "70": '"熊战士", "拍拍", "拍拍熊"', "71": '"裂魂人", "白牛", "sb"', "72": '"矮人直升机", "飞机"', "73": '"炼金术士", "炼金"', "74": '"祈求者", "卡尔"', "75": '"沉默术士", "沉默"', "76": '"殁境神蚀者", "黑鸟"', "77": '"狼人"', "78": '"酒仙", "熊猫", "熊猫酒仙"', "79": '"暗影恶魔", "毒狗"', "80": '"德鲁伊", "熊德"', "81": '"混沌骑士", "混沌", "CK"', "82": '"米波"', "83": '"树精卫士", "大树", "树精"', "84": '"食人魔魔法师", "蓝胖"', "85": '"不朽尸王", "尸王"', "86": '"拉比克"', "87": '"干扰者", "萨尔"', "88": '"司夜刺客", "小强"', "89": '"娜迦海妖", "小娜迦"', "90": '"光之守卫", "光法"', "91": '"艾欧", "小精灵", "精灵", "IO"', "92": '"维萨吉", "死灵龙", "死灵飞龙"', "93": '"斯拉克", "小鱼", "小鱼人"', "94": '"美杜莎", "一姐", "美杜莎"', "95": '"巨魔战将", "巨魔", "巨馍蘸酱"', "96": '"半人马战行者", "人马", "半人马"', "97": '"马格纳斯", "猛犸"', "98": '"伐木机", "花母鸡"', "99": '"钢背兽", "钢背"', "100": '"巨牙海民", "海民"', "101": '"天怒法师", "天怒"', "102": '"亚巴顿"', "103": '"上古巨神", "大牛"', "104": '"军团指挥官", "军团"', "105": '"工程师", "炸弹", "炸弹人"', "106": '"灰烬之灵", "火猫"', "107": '"大地之灵", "土猫"', "108": '"孽主", "大屁股"', "109": '"恐怖利刃", "TB"', "110": '"凤凰", "烧鸡"', "111": '"神谕者", "神谕"', "112": '"寒冬飞龙", "冰龙"', "113": '"天穹守望者", "电狗"', "114": '"齐天大圣", "大圣"', "119": '"邪影芳灵", "小仙女", "花仙子"', "120": '"石鳞剑士", "滚滚"', "121": '"天涯墨客", "墨客"', "123": '"森海飞霞", "松鼠", "小松鼠", "小松许"', "126": '"虚无之灵", "紫猫"', "128": '"电炎绝手", "老奶奶"', "129": '"玛尔斯"', "131": '"百戏大王"', "135": '"破晓辰星", "大锤"', "136": '"玛西"', "137": '"獸", "畜"', "138": '"琼英碧灵", "奶绿", "绿奶奶"', "145": '"凯", "鸟人"', "155": '"朗戈"' }, broadcast: { WIN_NEGATIVE: '"侥幸赢得了比赛", "走狗屎运赢得了比赛", "躺赢了比赛", "打团都没来, 队友4V5赢得了比赛"', WIN_POSITIVE: '"带领团队走向了胜利", "暴打对面后赢得了胜利", " CARRY全场赢得了胜利", "把对面当猪宰了, 赢得了胜利", "又赢了, 这游戏就是这么枯燥, 且乏味", "直接进行一个比赛的赢"', LOSE_NEGATIVE: '"被人按在地上摩擦, 输掉了这场比赛", "悲惨地输掉了比赛", "头都被打歪了, 心态爆炸地输掉了比赛", "捕鱼被鱼吃了, 输掉了比赛", "打的是个几把", "直接进行一个比赛的输"', LOSE_POSITIVE: '"无力回天输掉了比赛", "尽力了, 但还是输了比赛", "背靠世界树, 虽败犹荣", "带不动队友, 输了比赛", "又输了, 很难受, 宁愿输的是我"', message: "{name}的{hero_name}{comment}。\nKDA:{kda},GPM/XPM:{gpm_xpm},补刀/反补:{lh_dn},伤害/塔伤:{damage},参战/参葬率:{kc_dc}", rank_changed: "群友 {name} 段位变动:{prev.medal}{prev.star} → {curr.medal}{curr.star}" }, logger: { fetch_guilds_failed: "获取群组信息失败,将继续后续步骤。", match_tracked: "追踪到最新比赛 {match.id} 来自{#each messageToLogger as item}群组 {item.platform}:{item.guildId} 的玩家 [{#each item.players as player}{player.nickname}({player.steamId}){#if player !== item.players[item.players.length - 1]}、{/if}{/each}]{#if item !== messageToLogger[messageToLogger.length - 1]}、{/if}{/each}。", parse_request_sent: "比赛 {matchId} 解析请求已成功发送至STRATZ服务器。", parse_request_failed: "比赛 {matchId} 解析请求发送失败。", match_parsed: "比赛 {matchId} 已{#if odParsed}由 OpenDota {/if}解析,生成图片并发布于{#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}、{/if}{/each}。", match_unparsed: "比赛 {matchId} 超过等待时间[{timeout}分钟]仍未解析,生成图片并发布于{#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}、{/if}{/each}。", waiting_for_parse: "比赛 {matchId} 尚未解析完成,已等待{time}分钟。", report_sent: "发布{title}于{platform}:{guildId}。", rank_sent: "向{platform}:{guildId}发布{player.nickName}({player.steamId})的段位变动信息。", ejs_error: "EJS模板渲染错误:{error}", cron_not_enabled: "未启用cron服务,无法运行战报追踪等定时任务。", stratz_token_banned: "Stratz API 请求被拒绝(403),若频繁发生很有可能意味着您的Token或IP因异常使用被临时限制访问。有关此报错请见文档:http://sjtdev.github.io/koishi-plugin-dota2tracker/api-403.html", opendota_token_banned: "OpenDota API 请求被拒绝(403),请注意访问次数是否超限。", stratz_api_query_error: "Stratz API 返回了有效数据,但同时也返回了查询报错。错误信息: {cause}", opendota_parse_request_sent: "比赛 {matchId} 解析请求已成功发送至 OpenDota 服务器。", opendota_parse_request_failed: "比赛 {matchId} 解析请求向 OpenDota 服务器发送失败。" }, time: { years_months_ago: "{years}年{months}个月前", years_ago: "{years}年前" } } };
820
+ module2.exports = { dota2tracker: { heroes_nicknames: { "0": '请严格遵循 "", "" 格式填写(如下方默认数据,注意是英文半角符号),如果格式有误将仅使用英雄默认名称。可以不包含英雄默认名称。', "1": '"敌法师", "敌法", "AM"', "2": '"斧王"', "3": '"祸乱之源", "祸乱", "水桶腰"', "4": '"血魔"', "5": '"水晶室女", "冰女", "CM"', "6": '"卓尔游侠", "小黑"', "7": '"撼地者", "小牛", "牛头"', "8": '"主宰", "剑圣", "jugg", "奶棒人"', "9": '"米拉娜", "白虎", "pom"', "10": '"变体精灵", "水人"', "11": '"影魔", "影魔王", "SF", "影儿魔儿"', "12": '"幻影长矛手", "PL"', "13": '"帕克"', "14": '"帕吉", "屠夫", "扒鸡", "啪唧"', "15": '"雷泽", "电魂", "电棍"', "16": '"沙王", "SK"', "17": '"风暴之灵", "蓝猫"', "18": '"斯温", "流浪剑客", "流浪"', "19": '"小小"', "20": '"复仇之魂", "复仇", "VS"', "21": '"风行者", "风行", "WR"', "22": '"宙斯"', "23": '"昆卡", "船长"', "25": '"莉娜", "火女"', "26": '"莱恩", "恶魔巫师", "Lion"', "27": '"暗影萨满", "小Y", "小歪"', "28": '"斯拉达", "大鱼", "大鱼人"', "29": '"潮汐猎人", "潮汐", "西瓜皮"', "30": '"巫医"', "31": '"巫妖"', "32": '"力丸", "隐形刺客", "隐刺"', "33": '"谜团"', "34": '"修补匠", "TK", "Tinker"', "35": '"狙击手", "矮人火枪手", "火枪", "传说哥"', "36": '"瘟疫法师", "死灵法", "NEC"', "37": '"术士", "Warlock"', "38": '"兽王"', "39": '"痛苦女王", "女王", "QOP"', "40": '"剧毒术士", "剧毒"', "41": '"虚空假面", "虚空", "JB脸"', "42": '"冥魂大帝", "骷髅王"', "43": '"死亡先知", "DP"', "44": '"幻影刺客", "幻刺", "PA"', "45": '"帕格纳", "骨法", "湮灭法师"', "46": '"圣堂刺客", "圣堂", "TA"', "47": '"冥界亚龙", "毒龙", "Viper"', "48": '"露娜", "月骑", "Luna"', "49": '"龙骑士", "龙骑"', "50": '"戴泽", "暗影牧师", "暗牧"', "51": '"发条技师", "发条"', "52": '"拉席克", "老鹿"', "53": '"先知"', "54": '"噬魂鬼", "小狗"', "55": '"黑暗贤者", "黑贤"', "56": '"克林克兹", "小骷髅"', "57": '"全能骑士", "全能"', "58": '"魅惑魔女", "小鹿"', "59": '"哈斯卡", "神灵", "神灵武士"', "60": '"暗夜魔王", "夜魔"', "61": '"育母蜘蛛", "蜘蛛"', "62": '"赏金猎人", "赏金"', "63": '"编织者", "蚂蚁"', "64": '"杰奇洛", "双头龙"', "65": '"蝙蝠骑士", "蝙蝠"', "66": '"陈", "老陈"', "67": '"幽鬼", "SPE", "UG"', "68": '"远古冰魄", "冰魂"', "69": '"末日使者", "末日", "Doom"', "70": '"熊战士", "拍拍", "拍拍熊"', "71": '"裂魂人", "白牛", "sb"', "72": '"矮人直升机", "飞机"', "73": '"炼金术士", "炼金"', "74": '"祈求者", "卡尔"', "75": '"沉默术士", "沉默"', "76": '"殁境神蚀者", "黑鸟"', "77": '"狼人"', "78": '"酒仙", "熊猫", "熊猫酒仙"', "79": '"暗影恶魔", "毒狗"', "80": '"德鲁伊", "熊德"', "81": '"混沌骑士", "混沌", "CK"', "82": '"米波"', "83": '"树精卫士", "大树", "树精"', "84": '"食人魔魔法师", "蓝胖"', "85": '"不朽尸王", "尸王"', "86": '"拉比克"', "87": '"干扰者", "萨尔"', "88": '"司夜刺客", "小强"', "89": '"娜迦海妖", "小娜迦"', "90": '"光之守卫", "光法"', "91": '"艾欧", "小精灵", "精灵", "IO"', "92": '"维萨吉", "死灵龙", "死灵飞龙"', "93": '"斯拉克", "小鱼", "小鱼人"', "94": '"美杜莎", "一姐", "美杜莎"', "95": '"巨魔战将", "巨魔", "巨馍蘸酱"', "96": '"半人马战行者", "人马", "半人马"', "97": '"马格纳斯", "猛犸"', "98": '"伐木机", "花母鸡"', "99": '"钢背兽", "钢背"', "100": '"巨牙海民", "海民"', "101": '"天怒法师", "天怒"', "102": '"亚巴顿"', "103": '"上古巨神", "大牛"', "104": '"军团指挥官", "军团"', "105": '"工程师", "炸弹", "炸弹人"', "106": '"灰烬之灵", "火猫"', "107": '"大地之灵", "土猫"', "108": '"孽主", "大屁股"', "109": '"恐怖利刃", "TB"', "110": '"凤凰", "烧鸡"', "111": '"神谕者", "神谕"', "112": '"寒冬飞龙", "冰龙"', "113": '"天穹守望者", "电狗"', "114": '"齐天大圣", "大圣"', "119": '"邪影芳灵", "小仙女", "花仙子"', "120": '"石鳞剑士", "滚滚"', "121": '"天涯墨客", "墨客"', "123": '"森海飞霞", "松鼠", "小松鼠", "小松许"', "126": '"虚无之灵", "紫猫"', "128": '"电炎绝手", "老奶奶"', "129": '"玛尔斯"', "131": '"百戏大王"', "135": '"破晓辰星", "大锤"', "136": '"玛西"', "137": '"獸", "畜"', "138": '"琼英碧灵", "奶绿", "绿奶奶"', "145": '"凯", "鸟人"', "155": '"朗戈"' }, broadcast: { WIN_NEGATIVE: '"侥幸赢得了比赛", "走狗屎运赢得了比赛", "躺赢了比赛", "打团都没来, 队友4V5赢得了比赛"', WIN_POSITIVE: '"带领团队走向了胜利", "暴打对面后赢得了胜利", " CARRY全场赢得了胜利", "把对面当猪宰了, 赢得了胜利", "又赢了, 这游戏就是这么枯燥, 且乏味", "直接进行一个比赛的赢"', LOSE_NEGATIVE: '"被人按在地上摩擦, 输掉了这场比赛", "悲惨地输掉了比赛", "头都被打歪了, 心态爆炸地输掉了比赛", "捕鱼被鱼吃了, 输掉了比赛", "打的是个几把", "直接进行一个比赛的输"', LOSE_POSITIVE: '"无力回天输掉了比赛", "尽力了, 但还是输了比赛", "背靠世界树, 虽败犹荣", "带不动队友, 输了比赛", "又输了, 很难受, 宁愿输的是我"', message: "{name}的{hero_name}{comment}。\nKDA:{kda},GPM/XPM:{gpm_xpm},补刀/反补:{lh_dn},伤害/塔伤:{damage},参战/参葬率:{kc_dc}", rank_changed: "群友 {name} 段位变动:{prev.medal}{prev.star} → {curr.medal}{curr.star}" }, logger: { fetch_guilds_failed: "获取群组信息失败,将继续后续步骤。", match_tracked: "追踪到最新比赛 {match.id} 来自{#each messageToLogger as item}群组 {item.platform}:{item.guildId} 的玩家 [{#each item.players as player}{player.nickname}({player.steamId}){#if player !== item.players[item.players.length - 1]}、{/if}{/each}]{#if item !== messageToLogger[messageToLogger.length - 1]}、{/if}{/each}。", parse_request_sent: "比赛 {matchId} 解析请求已成功发送至STRATZ服务器。", parse_request_failed: "比赛 {matchId} 解析请求发送失败。", match_parsed: "比赛 {matchId} 已{#if odParsed}由 OpenDota {/if}解析,生成图片并发布于{#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}、{/if}{/each}。", match_unparsed: "比赛 {matchId} 超过等待时间[{timeout}分钟]仍未解析,生成图片并发布于{#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}、{/if}{/each}。", waiting_for_parse: "比赛 {matchId} 尚未解析完成,已等待{time}分钟。", report_sent: "发布{title}于{platform}:{guildId}。", rank_sent: "向{platform}:{guildId}发布{player.nickName}({player.steamId})的段位变动信息。", ejs_error: "EJS模板渲染错误:{error}", cron_not_enabled: "未启用cron服务,无法运行战报追踪等定时任务。", stratz_token_banned: "Stratz API 请求被拒绝(403),若频繁发生很有可能意味着您的Token或IP因异常使用被临时限制访问。有关此报错请见文档:http://sjtdev.github.io/koishi-plugin-dota2tracker/api-403.html", opendota_token_banned: "OpenDota API 请求被拒绝(403),请注意访问次数是否超限。", stratz_api_query_error: "Stratz API 返回了有效数据,但同时也返回了查询报错。错误信息: {cause}", opendota_parse_request_sent: "比赛 {matchId} 解析请求已成功发送至 OpenDota 服务器。", opendota_parse_request_failed: "比赛 {matchId} 解析请求向 OpenDota 服务器发送失败。", font_loaded: "字体目录发生变化: {filename} ({eventType}),重新加载字体列表..." }, time: { years_months_ago: "{years}年{months}个月前", years_ago: "{years}年前" } } };
821
821
  }
822
822
  });
823
823
 
@@ -831,7 +831,7 @@ __export(src_exports, {
831
831
  usage: () => usage
832
832
  });
833
833
  module.exports = __toCommonJS(src_exports);
834
- var import_path4 = __toESM(require("path"));
834
+ var import_node_path5 = __toESM(require("node:path"));
835
835
 
836
836
  // src/app/common/i18n.ts
837
837
  var import_koishi = require("koishi");
@@ -1393,7 +1393,7 @@ var ItemService = class _ItemService extends import_koishi3.Service {
1393
1393
  var import_koishi4 = require("koishi");
1394
1394
 
1395
1395
  // src/app/common/error.ts
1396
- var import_util = require("util");
1396
+ var import_node_util = require("node:util");
1397
1397
  var import_axios = __toESM(require("axios"));
1398
1398
  var NetworkError = class extends Error {
1399
1399
  static {
@@ -1510,7 +1510,7 @@ function handleError(error, logger, i18n, config) {
1510
1510
  if (error instanceof Error && error.stack) {
1511
1511
  output += error.stack;
1512
1512
  } else {
1513
- output += (0, import_util.inspect)(error, { depth: null });
1513
+ output += (0, import_node_util.inspect)(error, { depth: null });
1514
1514
  }
1515
1515
  logger.error(output);
1516
1516
  }
@@ -2314,9 +2314,12 @@ var DatabaseService = class extends import_koishi7.Service {
2314
2314
  );
2315
2315
  ctx.model.extend("dt_match_extension", { matchId: "unsigned", startTime: "timestamp", data: "json" }, { autoInc: false, primary: ["matchId"] });
2316
2316
  }
2317
- async insertReportData(matchId, startTime, data) {
2317
+ async insertMatchExtension(matchId, startTime, data) {
2318
2318
  return this.ctx.database.upsert("dt_match_extension", [{ matchId, startTime, data }]);
2319
2319
  }
2320
+ async getMatchExtension(matchIds) {
2321
+ return this.ctx.database.get("dt_match_extension", { matchId: matchIds });
2322
+ }
2320
2323
  async setPlayerRank(playerId, rank) {
2321
2324
  return this.ctx.database.set("dt_subscribed_players", playerId, { rank });
2322
2325
  }
@@ -2387,9 +2390,9 @@ var DatabaseService = class extends import_koishi7.Service {
2387
2390
  };
2388
2391
 
2389
2392
  // src/app/data/stratz.api.ts
2390
- var import_fs = __toESM(require("fs"));
2393
+ var import_node_fs = __toESM(require("node:fs"));
2391
2394
  var import_koishi8 = require("koishi");
2392
- var import_path = __toESM(require("path"));
2395
+ var import_node_path = __toESM(require("node:path"));
2393
2396
  var import_axios2 = __toESM(require("axios"));
2394
2397
  var import_https_proxy_agent = require("https-proxy-agent");
2395
2398
  var StratzAPI = class extends import_koishi8.Service {
@@ -2404,7 +2407,7 @@ var StratzAPI = class extends import_koishi8.Service {
2404
2407
  constructor(ctx, currentDir) {
2405
2408
  super(ctx, "dota2tracker.stratz-api", true);
2406
2409
  this.config = ctx.config;
2407
- this.graphqlQueriesDir = import_path.default.join(currentDir, "queries");
2410
+ this.graphqlQueriesDir = import_node_path.default.join(currentDir, "queries");
2408
2411
  this.queue = new MiniQueue(ctx, { interval: 200 });
2409
2412
  this.http = import_axios2.default.create({ timeout: 15e3, signal: this.abortController.signal });
2410
2413
  ctx.on("dispose", () => this.dispose());
@@ -2426,6 +2429,16 @@ var StratzAPI = class extends import_koishi8.Service {
2426
2429
  (data) => !!data?.player
2427
2430
  );
2428
2431
  }
2432
+ async queryPlayersMatchesForDaily_legacy(steamAccountIds, seconds) {
2433
+ return this.query(
2434
+ "PlayersMatchesForDaily_Legacy",
2435
+ {
2436
+ steamAccountIds,
2437
+ seconds
2438
+ },
2439
+ (data) => !!data?.players
2440
+ );
2441
+ }
2429
2442
  async queryPlayersMatchesForDaily(steamAccountIds, seconds) {
2430
2443
  return this.query(
2431
2444
  "PlayersMatchesForDaily",
@@ -2531,7 +2544,7 @@ var StratzAPI = class extends import_koishi8.Service {
2531
2544
  });
2532
2545
  }
2533
2546
  loadGraphqlFile(queryName) {
2534
- return import_fs.default.readFileSync(import_path.default.join(this.graphqlQueriesDir, `${queryName}.graphql`), { encoding: "utf-8" }).replace(/[\r\n]+/g, " ");
2547
+ return import_node_fs.default.readFileSync(import_node_path.default.join(this.graphqlQueriesDir, `${queryName}.graphql`), { encoding: "utf-8" }).replace(/[\r\n]+/g, " ");
2535
2548
  }
2536
2549
  };
2537
2550
  var MiniQueue = class {
@@ -2605,7 +2618,7 @@ var ValveAPI = class extends import_koishi9.Service {
2605
2618
  this.abortController.abort();
2606
2619
  }
2607
2620
  // 7. 提取通用的 fetchData
2608
- async fetchData(path5, languageTag) {
2621
+ async fetchData(path6, languageTag) {
2609
2622
  const config = {
2610
2623
  headers: {},
2611
2624
  httpAgent: void 0,
@@ -2620,10 +2633,10 @@ var ValveAPI = class extends import_koishi9.Service {
2620
2633
  config.params.language = this.ctx.dota2tracker.i18n.getValveLanguageTag(languageTag);
2621
2634
  }
2622
2635
  try {
2623
- const response = await this.http.get(path5, config);
2636
+ const response = await this.http.get(path6, config);
2624
2637
  return response.data;
2625
2638
  } catch (error) {
2626
- processFetchError(error, this.name, path5);
2639
+ processFetchError(error, this.name, path6);
2627
2640
  }
2628
2641
  }
2629
2642
  async queryHeroDetailsFromValve(heroId, languageTag = "zh-CN") {
@@ -2647,8 +2660,8 @@ var ValveAPI = class extends import_koishi9.Service {
2647
2660
  // src/app/presentation/view.renderer.ts
2648
2661
  var import_koishi10 = require("koishi");
2649
2662
  var import_ejs = __toESM(require("ejs"));
2650
- var import_fs2 = __toESM(require("fs"));
2651
- var import_path2 = __toESM(require("path"));
2663
+ var import_node_fs2 = __toESM(require("node:fs"));
2664
+ var import_node_path2 = __toESM(require("node:path"));
2652
2665
 
2653
2666
  // src/app/common/types.ts
2654
2667
  var ImageType = /* @__PURE__ */ ((ImageType2) => {
@@ -2670,6 +2683,7 @@ var ImageFormat = /* @__PURE__ */ ((ImageFormat2) => {
2670
2683
 
2671
2684
  // src/app/presentation/view.renderer.ts
2672
2685
  var import_luxon5 = require("luxon");
2686
+ var import_node_url = require("node:url");
2673
2687
  var ViewRenderer = class extends import_koishi10.Service {
2674
2688
  static {
2675
2689
  __name(this, "ViewRenderer");
@@ -2678,18 +2692,55 @@ var ViewRenderer = class extends import_koishi10.Service {
2678
2692
  constructor(ctx, currentDir) {
2679
2693
  super(ctx, "dota2tracker.image", true);
2680
2694
  this.config = ctx.config;
2681
- this.templateDir = import_path2.default.join(currentDir, "templates");
2695
+ this.templateDir = import_node_path2.default.join(currentDir, "templates");
2682
2696
  }
2683
2697
  async renderToImageByFile(data, templateName, type, languageTag) {
2684
2698
  const html = await this.generateHTML(data, { source: "FILE", templateName, type }, languageTag);
2685
- return this.ctx.puppeteer.render(html);
2699
+ return this.render(html);
2686
2700
  }
2687
2701
  async renderToImageByEJSCode(data, ejsCode, languageTag) {
2688
2702
  const html = await this.generateHTML(data, { source: "CODE", code: ejsCode }, languageTag);
2689
- return this.ctx.puppeteer.render(html);
2703
+ return this.render(html);
2690
2704
  }
2691
2705
  async renderToImageByHTML(html) {
2692
- return this.ctx.puppeteer.render(html);
2706
+ return this.render(html);
2707
+ }
2708
+ async render(html) {
2709
+ const { fonts } = this.config;
2710
+ const finalHtml = html.replace("</head>", `${this.getFontStyleBlock()}</head>`);
2711
+ const fontFamilies = Array.from(/* @__PURE__ */ new Set([...fonts.sans || [], ...fonts.serif || [], ...fonts.mono || []])).filter(Boolean);
2712
+ return this.ctx.puppeteer.render(
2713
+ finalHtml,
2714
+ fontFamilies.length === 0 ? void 0 : async (page, next) => {
2715
+ let fontInfos = [];
2716
+ try {
2717
+ fontInfos = this.ctx.dota2tracker.font.getFonts(fontFamilies);
2718
+ } catch (e) {
2719
+ this.ctx.logger.warn("Failed to get font info, using fallback fonts:", e);
2720
+ }
2721
+ if (fontInfos.length > 0) {
2722
+ await page.exposeFunction("dota2tracker_font_service_get_format", (format) => {
2723
+ return this.ctx.dota2tracker.font.getFontFormat(format);
2724
+ });
2725
+ await page.evaluate(
2726
+ async (fonts2) => {
2727
+ const win = window;
2728
+ const loaders = fonts2.map(async (font) => {
2729
+ const format = await win.dota2tracker_font_service_get_format(font.format);
2730
+ const fontFace = new win.FontFace(font.family, `url("${font.path}") format("${format}")`, font.descriptors);
2731
+ win.document.fonts.add(fontFace);
2732
+ await fontFace.load();
2733
+ });
2734
+ await Promise.all(loaders);
2735
+ await win.document.fonts.ready;
2736
+ },
2737
+ fontInfos.map((f) => ({ ...f, path: (0, import_node_url.pathToFileURL)(f.path).href }))
2738
+ );
2739
+ }
2740
+ const body = await page.$("body");
2741
+ return next(body);
2742
+ }
2743
+ );
2693
2744
  }
2694
2745
  async generateHTML(data, template, languageTag) {
2695
2746
  const templateData = {
@@ -2707,7 +2758,7 @@ var ViewRenderer = class extends import_koishi10.Service {
2707
2758
  try {
2708
2759
  let html;
2709
2760
  if (template.source === "FILE") {
2710
- const templatePath = import_path2.default.join(this.templateDir, template.type, `${template.templateName}.ejs`);
2761
+ const templatePath = import_node_path2.default.join(this.templateDir, template.type, `${template.templateName}.ejs`);
2711
2762
  html = await import_ejs.default.renderFile(templatePath, templateData, {
2712
2763
  strict: false
2713
2764
  });
@@ -2717,7 +2768,7 @@ var ViewRenderer = class extends import_koishi10.Service {
2717
2768
  async: true
2718
2769
  });
2719
2770
  }
2720
- if (process.env.NODE_ENV === "development") import_fs2.default.writeFileSync(import_path2.default.resolve(process.cwd(), "temp.html"), html);
2771
+ if (process.env.NODE_ENV === "development") import_node_fs2.default.writeFileSync(import_node_path2.default.resolve(process.cwd(), "temp.html"), html);
2721
2772
  return html;
2722
2773
  } catch (error) {
2723
2774
  this.logger.error(error);
@@ -2727,22 +2778,210 @@ var ViewRenderer = class extends import_koishi10.Service {
2727
2778
  getImageUrl(image, type = "local" /* Local */, format = "png" /* png */) {
2728
2779
  if (type === "local" /* Local */) {
2729
2780
  try {
2730
- if (format === "svg" /* svg */) return import_fs2.default.readFileSync(import_path2.default.join(this.templateDir, "images", `${image}.svg`));
2731
- const imageData = import_fs2.default.readFileSync(import_path2.default.join(this.templateDir, "images", `${image}.${format}`));
2732
- const base64Data = imageData.toString("base64");
2733
- return `data:image/png;base64,${base64Data}`;
2781
+ const absolutePath = import_node_path2.default.join(this.templateDir, "images", `${image}.${format}`);
2782
+ return (0, import_node_url.pathToFileURL)(absolutePath).href;
2734
2783
  } catch (error) {
2735
2784
  console.error(error);
2736
2785
  return "";
2737
2786
  }
2738
2787
  } else return `https://cdn.akamai.steamstatic.com/apps/dota2/images/dota_react/${type}/${image}.${format}`;
2739
2788
  }
2789
+ // 1. 生成 CSS 注入块
2790
+ getFontStyleBlock() {
2791
+ const { fonts } = this.config;
2792
+ const formatFontStack = /* @__PURE__ */ __name((fontList, fallback) => {
2793
+ const quoted = fontList.map((f) => `"${f}"`).join(", ");
2794
+ return quoted ? `${quoted}, ${fallback}` : fallback;
2795
+ }, "formatFontStack");
2796
+ const sans = formatFontStack(fonts.sans, "sans-serif");
2797
+ const serif = formatFontStack(fonts.serif, "serif");
2798
+ const mono = formatFontStack(fonts.mono, "monospace");
2799
+ return `
2800
+ <style>
2801
+ /* 1. 定义 CSS 变量 (供原生 CSS 使用) */
2802
+ :root {
2803
+ --font-sans: ${sans};
2804
+ --font-serif: ${serif};
2805
+ --font-mono: ${mono};
2806
+ }
2807
+
2808
+ /* 2. 暴力劫持 Tailwind 类 (供 Tailwind 使用) */
2809
+ /* 使用 !important 确保优先级最高,覆盖 Tailwind 默认生成的样式 */
2810
+ .font-sans { font-family: var(--font-sans) !important; }
2811
+ .font-serif { font-family: var(--font-serif) !important; }
2812
+ .font-mono { font-family: var(--font-mono) !important; }
2813
+
2814
+ /* 3. 设置全局默认字体 */
2815
+ body {
2816
+ font-family: var(--font-sans);
2817
+ }
2818
+ </style>
2819
+ `;
2820
+ }
2740
2821
  };
2741
2822
 
2742
- // src/app/presentation/message.builder.ts
2823
+ // src/app/presentation/font.service.ts
2743
2824
  var import_koishi11 = require("koishi");
2825
+ var import_node_path3 = __toESM(require("node:path"));
2826
+ var import_node_fs3 = __toESM(require("node:fs"));
2827
+ var import_fontkit = __toESM(require("fontkit"));
2828
+ var FontFormats = {
2829
+ WEB_OPEN_FONT_FORMAT: "woff",
2830
+ WEB_OPEN_FONT_FORMAT_2: "woff2",
2831
+ TRUE_TYPE_FONT: "ttf",
2832
+ OPEN_TYPE_FONT: "otf",
2833
+ SPLINE_FONT: "sfnt",
2834
+ TRUE_TYPE_COLLECTION: "ttc",
2835
+ GOOGLE_FONT: "google",
2836
+ MANIFEST: "manifest"
2837
+ };
2838
+ var FontService = class extends import_koishi11.Service {
2839
+ static {
2840
+ __name(this, "FontService");
2841
+ }
2842
+ watcher;
2843
+ debounceTimer;
2844
+ fonts = [];
2845
+ constructor(ctx) {
2846
+ super(ctx, "dota2tracker.font", true);
2847
+ this.config = ctx.config;
2848
+ this.ctx.on("ready", async () => await this.initialize());
2849
+ }
2850
+ async initialize() {
2851
+ const fontsPath = import_node_path3.default.resolve(this.ctx.baseDir, this.config.fontPath);
2852
+ if (!import_node_fs3.default.existsSync(fontsPath)) {
2853
+ try {
2854
+ import_node_fs3.default.mkdirSync(fontsPath, { recursive: true });
2855
+ } catch (e) {
2856
+ this.logger.warn(`Failed to create font directory: ${e.message}`);
2857
+ return;
2858
+ }
2859
+ }
2860
+ await this.loadFonts(fontsPath);
2861
+ try {
2862
+ this.watcher = import_node_fs3.default.watch(fontsPath, (eventType, filename) => {
2863
+ if (filename && /\.(ttf|otf|woff2?|ttc|sfnt)$/.test(filename)) {
2864
+ if (this.debounceTimer) clearTimeout(this.debounceTimer);
2865
+ this.debounceTimer = setTimeout(() => {
2866
+ this.logger.debug(this.ctx.dota2tracker.i18n.gt("dota2tracker.logger.font_loader", { filename: "batch", eventType: "change" }));
2867
+ this.loadFonts(fontsPath);
2868
+ }, 200);
2869
+ }
2870
+ });
2871
+ } catch (e) {
2872
+ this.logger.warn(`Failed to watch font directory: ${e.message}`);
2873
+ }
2874
+ this.ctx.on("dispose", () => {
2875
+ if (this.watcher) this.watcher.close();
2876
+ if (this.debounceTimer) clearTimeout(this.debounceTimer);
2877
+ });
2878
+ }
2879
+ async loadFonts(fontsPath) {
2880
+ if (!import_node_fs3.default.existsSync(fontsPath)) return;
2881
+ const newFonts = [];
2882
+ try {
2883
+ import_node_fs3.default.readdirSync(fontsPath).forEach((file) => {
2884
+ if (!/\.(ttf|otf|woff2?|ttc|sfnt)$/.test(file)) return;
2885
+ const fullPath = import_node_path3.default.join(fontsPath, file);
2886
+ try {
2887
+ const fontOrCollection = import_fontkit.default.openSync(fullPath);
2888
+ const parsedFonts = "fonts" in fontOrCollection ? fontOrCollection.fonts : [fontOrCollection];
2889
+ parsedFonts.forEach((font) => {
2890
+ const family = this.getFontFamily(font);
2891
+ const descriptors = this.getFontDescriptors(font);
2892
+ newFonts.push({
2893
+ path: fullPath,
2894
+ family,
2895
+ format: this.getFileFormat(file),
2896
+ descriptors
2897
+ });
2898
+ });
2899
+ } catch (err) {
2900
+ this.logger.warn(`Failed to parse font ${file}: ${err.message}`);
2901
+ }
2902
+ });
2903
+ this.fonts = newFonts;
2904
+ const fontFamilies = Array.from(new Set(newFonts.map((f) => f.family))).sort();
2905
+ this.ctx.schema.set("dota2tracker.fonts", import_koishi11.Schema.union(fontFamilies));
2906
+ this.logger.info(`Loaded ${newFonts.length} fonts from ${fontsPath}`);
2907
+ } catch (e) {
2908
+ this.ctx.logger.warn(`Failed to load fonts: ${e.message}`);
2909
+ }
2910
+ }
2911
+ getFonts(families) {
2912
+ const uniquePaths = /* @__PURE__ */ new Set();
2913
+ const result = [];
2914
+ const uniqueFamilies = Array.from(new Set(families));
2915
+ for (const family of uniqueFamilies) {
2916
+ const matched = this.fonts.filter((f) => f.family === family);
2917
+ for (const font of matched) {
2918
+ if (!uniquePaths.has(font.path)) {
2919
+ uniquePaths.add(font.path);
2920
+ result.push(font);
2921
+ }
2922
+ }
2923
+ }
2924
+ return result;
2925
+ }
2926
+ getFontFamily(font) {
2927
+ const records = font.name?.records;
2928
+ if (records?.preferredFamily) {
2929
+ const langKeys = Object.keys(records.preferredFamily);
2930
+ const enKey = langKeys.find((k) => k.startsWith("en"));
2931
+ if (enKey) return records.preferredFamily[enKey];
2932
+ if (langKeys.length > 0) return records.preferredFamily[langKeys[0]];
2933
+ }
2934
+ return font.familyName;
2935
+ }
2936
+ getFontDescriptors(font) {
2937
+ const descriptors = {};
2938
+ if (font.usWeightClass) {
2939
+ descriptors.weight = font.usWeightClass.toString();
2940
+ } else if (font["OS/2"] && font["OS/2"].usWeightClass) {
2941
+ descriptors.weight = font["OS/2"].usWeightClass.toString();
2942
+ }
2943
+ if (font.italicAngle && font.italicAngle !== 0) {
2944
+ descriptors.style = "italic";
2945
+ }
2946
+ const widthClass = font["OS/2"]?.usWidthClass;
2947
+ if (widthClass) {
2948
+ const widthMap = {
2949
+ 1: "ultra-condensed",
2950
+ 2: "extra-condensed",
2951
+ 3: "condensed",
2952
+ 4: "semi-condensed",
2953
+ 5: "normal",
2954
+ 6: "semi-expanded",
2955
+ 7: "expanded",
2956
+ 8: "extra-expanded",
2957
+ 9: "ultra-expanded"
2958
+ };
2959
+ if (widthMap[widthClass] && widthMap[widthClass] !== "normal") {
2960
+ descriptors.stretch = widthMap[widthClass];
2961
+ }
2962
+ }
2963
+ return descriptors;
2964
+ }
2965
+ getFileFormat(fileName) {
2966
+ return import_node_path3.default.extname(fileName).slice(1);
2967
+ }
2968
+ getFontFormat(format) {
2969
+ const formatMap = {
2970
+ [FontFormats.TRUE_TYPE_FONT]: "truetype",
2971
+ [FontFormats.OPEN_TYPE_FONT]: "opentype",
2972
+ [FontFormats.WEB_OPEN_FONT_FORMAT]: "woff",
2973
+ [FontFormats.WEB_OPEN_FONT_FORMAT_2]: "woff2",
2974
+ [FontFormats.TRUE_TYPE_COLLECTION]: "collection",
2975
+ [FontFormats.SPLINE_FONT]: "sfnt"
2976
+ };
2977
+ return formatMap[format] || format;
2978
+ }
2979
+ };
2980
+
2981
+ // src/app/presentation/message.builder.ts
2982
+ var import_koishi12 = require("koishi");
2744
2983
  var import_luxon6 = require("luxon");
2745
- var MessageBuilder = class extends import_koishi11.Service {
2984
+ var MessageBuilder = class extends import_koishi12.Service {
2746
2985
  static {
2747
2986
  __name(this, "MessageBuilder");
2748
2987
  }
@@ -2866,7 +3105,7 @@ var MessageBuilder = class extends import_koishi11.Service {
2866
3105
  const playerIds = players.map((player) => player.steamId);
2867
3106
  let broadPlayers = match.players.filter((item) => playerIds.includes(item.steamAccountId));
2868
3107
  for (let player of broadPlayers) {
2869
- const random = new import_koishi11.Random(() => enhancedSimpleHashToSeed(`${match.id}-${player.steamAccountId}-${player.playerSlot}`));
3108
+ const random = new import_koishi12.Random(() => enhancedSimpleHashToSeed(`${match.id}-${player.steamAccountId}-${player.playerSlot}`));
2870
3109
  let comment;
2871
3110
  if (player.isRadiant == match.didRadiantWin) {
2872
3111
  if (player.deathContribution < 0.2 || player.killContribution > 0.75 || player.heroDamage / player.networth > 1.5 || player.towerDamage > 1e4 || player.imp > 0)
@@ -3029,9 +3268,9 @@ function customConvertArrayOfString(str) {
3029
3268
  __name(customConvertArrayOfString, "customConvertArrayOfString");
3030
3269
 
3031
3270
  // src/app/tasks/match-watcher.task.ts
3032
- var import_koishi12 = require("koishi");
3271
+ var import_koishi13 = require("koishi");
3033
3272
  var import_luxon7 = require("luxon");
3034
- var MatchWatcherTask = class extends import_koishi12.Service {
3273
+ var MatchWatcherTask = class extends import_koishi13.Service {
3035
3274
  static {
3036
3275
  __name(this, "MatchWatcherTask");
3037
3276
  }
@@ -3154,9 +3393,9 @@ var MatchWatcherTask = class extends import_koishi12.Service {
3154
3393
  };
3155
3394
 
3156
3395
  // src/app/tasks/parse-polling.task.ts
3157
- var import_koishi13 = require("koishi");
3396
+ var import_koishi14 = require("koishi");
3158
3397
  var import_luxon8 = require("luxon");
3159
- var ParsePollingTask = class extends import_koishi13.Service {
3398
+ var ParsePollingTask = class extends import_koishi14.Service {
3160
3399
  static {
3161
3400
  __name(this, "ParsePollingTask");
3162
3401
  }
@@ -3291,44 +3530,46 @@ var ParsePollingTask = class extends import_koishi13.Service {
3291
3530
  };
3292
3531
 
3293
3532
  // src/app/tasks/report.task.ts
3294
- var import_koishi14 = require("koishi");
3533
+ var import_koishi15 = require("koishi");
3295
3534
  var import_luxon9 = require("luxon");
3296
- var ReportTask = class extends import_koishi14.Service {
3535
+ var ReportTask = class extends import_koishi15.Service {
3297
3536
  static {
3298
3537
  __name(this, "ReportTask");
3299
3538
  }
3300
- /*
3301
- 还没计划好怎么动这一坨,先原样移植吧。
3302
- */
3303
3539
  constructor(ctx) {
3304
- super(ctx, "dota2tracker.report", true);
3540
+ super(ctx, "dota2tracker.report-task", true);
3305
3541
  this.config = ctx.config;
3306
3542
  if (this.config.dailyReportSwitch) {
3307
3543
  ctx.cron(`0 ${this.config.dailyReportHours} * * *`, async () => {
3308
- try {
3309
- const oneDayAgo = Math.floor(import_luxon9.DateTime.now().minus({ days: 1 }).toSeconds());
3310
- await this.report(oneDayAgo, "dota2tracker.template.yesterdays_summary", this.config.dailyReportShowCombi);
3311
- } catch (error) {
3312
- handleError(error, this.logger, this.ctx.dota2tracker.i18n, this.config);
3313
- }
3544
+ await this.runDailyJob();
3314
3545
  });
3315
3546
  }
3316
3547
  if (this.config.weeklyReportSwitch) {
3317
3548
  ctx.cron(`0 ${this.config.weeklyReportDayHours[1]} * * ${this.config.weeklyReportDayHours[0]}`, async () => {
3318
- try {
3319
- const oneWeekAgo = Math.floor(import_luxon9.DateTime.now().minus({ weeks: 1 }).toSeconds());
3320
- await this.report(oneWeekAgo, "dota2tracker.template.last_weeks_summary", this.config.weeklyReportShowCombi);
3321
- } catch (error) {
3322
- handleError(error, this.logger, this.ctx.dota2tracker.i18n, this.config);
3323
- }
3549
+ await this.runWeeklyJob();
3324
3550
  });
3325
3551
  }
3326
3552
  }
3327
- async report(timeAgo, titleKey, showCombi) {
3553
+ async runDailyJob() {
3554
+ const bundles = await this.ctx.dota2tracker.report.generateDailyReportBundles();
3555
+ for (const bundle of bundles) {
3556
+ const image = await this.ctx.dota2tracker.view.renderToImageByFile(bundle.report, "daily", "report" /* Report */, await this.ctx.dota2tracker.i18n.getLanguageTag({ channelId: bundle.channelId }));
3557
+ await this.ctx.broadcast([`${bundle.platform}:${bundle.channelId}`], image);
3558
+ }
3559
+ }
3560
+ async runWeeklyJob() {
3561
+ try {
3562
+ const oneWeekAgo = Math.floor(import_luxon9.DateTime.now().minus({ weeks: 1 }).toSeconds());
3563
+ await this.report_legacy(oneWeekAgo, "dota2tracker.template.last_weeks_summary", this.config.weeklyReportShowCombi);
3564
+ } catch (error) {
3565
+ handleError(error, this.logger, this.ctx.dota2tracker.i18n, this.config);
3566
+ }
3567
+ }
3568
+ async report_legacy(timeAgo, titleKey, showCombi) {
3328
3569
  const subscribedGuilds = await this.ctx.database.get("dt_subscribed_guilds", void 0);
3329
3570
  const subscribedPlayersInGuild = (await this.ctx.database.get("dt_subscribed_players", void 0)).filter((player) => subscribedGuilds.some((guild) => guild.guildId == player.guildId));
3330
3571
  const steamIds = subscribedPlayersInGuild.map((player) => player.steamId).filter((value, index, self) => self.indexOf(value) === index);
3331
- const players = (await this.ctx.dota2tracker.stratzAPI.queryPlayersMatchesForDaily(steamIds, timeAgo)).players.filter((player) => player.matches?.length > 0);
3572
+ const players = (await this.ctx.dota2tracker.stratzAPI.queryPlayersMatchesForDaily_legacy(steamIds, timeAgo)).players.filter((player) => player.matches?.length > 0);
3332
3573
  const matches = players.map((player) => player.matches.map((match) => match)).flat().filter((item, index, self) => index === self.findIndex((t) => t.id === item.id));
3333
3574
  for (let subPlayer of subscribedPlayersInGuild) {
3334
3575
  let player = players.find((player2) => subPlayer.steamId == player2.steamAccount.id);
@@ -3390,7 +3631,7 @@ var ReportTask = class extends import_koishi14.Service {
3390
3631
  combinations,
3391
3632
  showCombi
3392
3633
  },
3393
- "daily",
3634
+ "daily_legacy",
3394
3635
  "report" /* Report */,
3395
3636
  languageTag
3396
3637
  )
@@ -3790,12 +4031,12 @@ function registerUserCommand(ctx) {
3790
4031
  __name(registerUserCommand, "registerUserCommand");
3791
4032
 
3792
4033
  // src/app/data/opendota.api.ts
3793
- var import_koishi15 = require("koishi");
4034
+ var import_koishi16 = require("koishi");
3794
4035
  var import_axios4 = __toESM(require("axios"));
3795
4036
  var import_https_proxy_agent3 = require("https-proxy-agent");
3796
- var import_http = require("http");
3797
- var import_https = require("https");
3798
- var OpenDotaAPI = class extends import_koishi15.Service {
4037
+ var import_node_http = require("node:http");
4038
+ var import_node_https = require("node:https");
4039
+ var OpenDotaAPI = class extends import_koishi16.Service {
3799
4040
  static {
3800
4041
  __name(this, "OpenDotaAPI");
3801
4042
  }
@@ -3812,18 +4053,18 @@ var OpenDotaAPI = class extends import_koishi15.Service {
3812
4053
  this.abortController.abort();
3813
4054
  }
3814
4055
  async queryMatchInfo(matchId) {
3815
- const path5 = `/matches/${matchId}`;
3816
- const data = await this.fetchData("GET", path5);
3817
- this.ctx.dota2tracker.cache.addOpendotaAPIRequestLog(path5, 1);
4056
+ const path6 = `/matches/${matchId}`;
4057
+ const data = await this.fetchData("GET", path6);
4058
+ this.ctx.dota2tracker.cache.addOpendotaAPIRequestLog(path6, 1);
3818
4059
  return data;
3819
4060
  }
3820
4061
  async requestParseMatch(matchId) {
3821
- const path5 = `/request/${matchId}`;
3822
- const job = await this.fetchData("POST", path5);
3823
- this.ctx.dota2tracker.cache.addOpendotaAPIRequestLog(path5, 10);
4062
+ const path6 = `/request/${matchId}`;
4063
+ const job = await this.fetchData("POST", path6);
4064
+ this.ctx.dota2tracker.cache.addOpendotaAPIRequestLog(path6, 10);
3824
4065
  return job;
3825
4066
  }
3826
- async fetchData(type, path5, data) {
4067
+ async fetchData(type, path6, data) {
3827
4068
  const config = {
3828
4069
  headers: {},
3829
4070
  httpAgent: void 0,
@@ -3833,8 +4074,8 @@ var OpenDotaAPI = class extends import_koishi15.Service {
3833
4074
  config.httpsAgent = new import_https_proxy_agent3.HttpsProxyAgent(this.config.proxyAddress);
3834
4075
  config.httpAgent = new import_https_proxy_agent3.HttpsProxyAgent(this.config.proxyAddress);
3835
4076
  } else if (this.config.OpenDotaIPStack === "ipv4") {
3836
- config.httpAgent = new import_http.Agent({ family: 4 });
3837
- config.httpsAgent = new import_https.Agent({ family: 4 });
4077
+ config.httpAgent = new import_node_http.Agent({ family: 4 });
4078
+ config.httpsAgent = new import_node_https.Agent({ family: 4 });
3838
4079
  }
3839
4080
  if (this.config.OPENDOTA_API_KEY) {
3840
4081
  config.headers["Authorization"] = `Bearer ${this.config.OPENDOTA_API_KEY}`;
@@ -3842,20 +4083,20 @@ var OpenDotaAPI = class extends import_koishi15.Service {
3842
4083
  try {
3843
4084
  let response;
3844
4085
  if (type === "GET") {
3845
- response = await this.http.get(path5, config);
4086
+ response = await this.http.get(path6, config);
3846
4087
  } else {
3847
- response = await this.http.post(path5, data, config);
4088
+ response = await this.http.post(path6, data, config);
3848
4089
  }
3849
4090
  return response.data;
3850
4091
  } catch (error) {
3851
- processFetchError(error, "OpenDota", path5);
4092
+ processFetchError(error, "OpenDota", path6);
3852
4093
  }
3853
4094
  }
3854
4095
  };
3855
4096
 
3856
4097
  // src/app/core/opendota.adapter.ts
3857
- var import_koishi16 = require("koishi");
3858
- var OpenDotaAdapter = class extends import_koishi16.Service {
4098
+ var import_koishi17 = require("koishi");
4099
+ var OpenDotaAdapter = class extends import_koishi17.Service {
3859
4100
  static {
3860
4101
  __name(this, "OpenDotaAdapter");
3861
4102
  }
@@ -4311,8 +4552,9 @@ function convertBuildingEvents(objectives) {
4311
4552
  __name(convertBuildingEvents, "convertBuildingEvents");
4312
4553
 
4313
4554
  // src/app/core/report.service.ts
4314
- var import_koishi17 = require("koishi");
4315
- var ReportService = class extends import_koishi17.Service {
4555
+ var import_koishi18 = require("koishi");
4556
+ var import_luxon11 = require("luxon");
4557
+ var ReportService = class _ReportService extends import_koishi18.Service {
4316
4558
  static {
4317
4559
  __name(this, "ReportService");
4318
4560
  }
@@ -4333,14 +4575,295 @@ var ReportService = class extends import_koishi17.Service {
4333
4575
  partyId: player.partyId
4334
4576
  });
4335
4577
  }
4336
- this.ctx.dota2tracker.database.insertReportData(extensionData.matchId, new Date(match.startDateTime * 1e3), extensionData);
4578
+ this.ctx.dota2tracker.database.insertMatchExtension(extensionData.matchId, new Date(match.startDateTime * 1e3), extensionData);
4579
+ }
4580
+ /**
4581
+ * 入口函数,返回报告数据
4582
+ */
4583
+ async generateDailyReportBundles(options = { days: 1 }) {
4584
+ const today = import_luxon11.DateTime.now().startOf("day");
4585
+ const targetDate = today.minus({ days: options.days });
4586
+ const dataStartDate = targetDate.minus({ days: options.days });
4587
+ const users = await this.ctx.dota2tracker.database.getActiveSubscribedPlayers();
4588
+ const steamIds = [...new Set(users.map((user) => user.steamId))];
4589
+ const data = await this.ctx.dota2tracker.stratzAPI.queryPlayersMatchesForDaily(steamIds, Math.floor(dataStartDate.toSeconds()));
4590
+ const allMatchIds = [...new Set(data.players.flatMap((p) => p.matches.map((m) => m.id)))].map((id) => Number(id));
4591
+ const extensions = await this.ctx.dota2tracker.database.getMatchExtension(allMatchIds);
4592
+ const getImageUrl = this.ctx.dota2tracker.view.getImageUrl.bind(this.ctx.dota2tracker.view);
4593
+ return await _ReportService.formatDailyReportBundles(
4594
+ data,
4595
+ users,
4596
+ extensions,
4597
+ this.ctx.dota2tracker.dotaconstants,
4598
+ targetDate,
4599
+ async (platform, guildId) => {
4600
+ const lang = await this.ctx.dota2tracker.i18n.getLanguageTag({ channelId: guildId });
4601
+ return {
4602
+ t: /* @__PURE__ */ __name((key, params) => this.ctx.i18n.render([lang], [key], params).join(""), "t"),
4603
+ locale: lang,
4604
+ getHeroName: /* @__PURE__ */ __name((heroId) => this.ctx.dota2tracker.i18n.$t(lang, `dota2tracker.template.hero_names.${heroId}`), "getHeroName")
4605
+ };
4606
+ },
4607
+ getImageUrl
4608
+ );
4609
+ }
4610
+ /**
4611
+ * 静态格式化函数,解耦数据获取与处理逻辑,方便测试与 HMR
4612
+ */
4613
+ static async formatDailyReportBundles(data, users, extensions, dotaconstants, targetDate, getTranslator, getImageUrl) {
4614
+ const bundles = [];
4615
+ const groups = this.groupUsersByChannel(users);
4616
+ for (const [key, squadUsers] of groups.entries()) {
4617
+ const [platform, channelId] = key.split(":");
4618
+ const { t, locale, getHeroName } = await getTranslator(platform, channelId);
4619
+ const squadSteamIds = squadUsers.map((u) => u.steamId);
4620
+ const squadPlayerData = data.players.filter((p) => squadSteamIds.includes(p.steamAccount.id));
4621
+ if (squadPlayerData.length === 0) continue;
4622
+ const squadStats = this.calculateSquadStats(squadPlayerData, squadSteamIds, targetDate);
4623
+ if (squadStats.totalMatches === 0) continue;
4624
+ const playerRows = [];
4625
+ const playerStats = [];
4626
+ const impactData = [];
4627
+ for (const user of squadUsers) {
4628
+ const playerData = squadPlayerData.find((p) => p.steamAccount.id === user.steamId);
4629
+ if (!playerData || playerData.matches.length === 0) continue;
4630
+ const processed = this.processPlayer(user, playerData, dotaconstants, targetDate, extensions, getImageUrl);
4631
+ if (processed.impact.matchCount === 0) continue;
4632
+ playerRows.push(processed.row);
4633
+ playerStats.push(processed.stats);
4634
+ impactData.push(processed.impact);
4635
+ }
4636
+ if (playerRows.length === 0) continue;
4637
+ this.calculateImpactPercentages(impactData);
4638
+ playerStats.sort((a, b) => b.maxMvpScore - a.maxMvpScore || b.avgKda - a.avgKda);
4639
+ const mvpStat = playerStats[0];
4640
+ const lvpStat = playerStats[playerStats.length - 1];
4641
+ const mvpPlayerData = squadPlayerData.find((p) => p.steamAccount.id === mvpStat.steamId);
4642
+ const lvpPlayerData = squadPlayerData.find((p) => p.steamAccount.id === lvpStat.steamId);
4643
+ playerRows.sort((a, b) => parseFloat(b.kda.ratio) - parseFloat(a.kda.ratio));
4644
+ playerRows.forEach((row, i) => row.rank = i + 1);
4645
+ const report = {
4646
+ meta: {
4647
+ date: targetDate.setLocale(locale).toFormat(t("dota2tracker.template.report.daily.meta.date_format")),
4648
+ summary: t("dota2tracker.template.report.daily.meta.summary", [channelId]),
4649
+ // footerId: t("dota2tracker.template.report.daily.meta.footer_format", [channelId.slice(-4).toUpperCase(), platform.toUpperCase()]),
4650
+ footerId: "koishi-plugin-@sjtdev/dota2tracker"
4651
+ },
4652
+ headerStats: {
4653
+ matches: { value: squadStats.totalMatches, subtext: t("dota2tracker.template.report.daily.stats.matches_subtext", [squadStats.totalWins, squadStats.totalMatches - squadStats.totalWins]) },
4654
+ winRate: {
4655
+ value: `${squadStats.winRate.toFixed(1)}%`,
4656
+ subtext: `${t("dota2tracker.template.report.daily.stats.vs_yesterday")} ${squadStats.winRateDiff >= 0 ? "▲" : "▼"} ${Math.abs(squadStats.winRateDiff).toFixed(1)}%`,
4657
+ isPositive: squadStats.winRateDiff >= 0,
4658
+ isWinRateAbove50: squadStats.winRate >= 50
4659
+ },
4660
+ kills: { value: squadStats.totalKills.toLocaleString(), subtext: t("dota2tracker.template.report.daily.stats.kills_avg", [squadStats.avgKills.toFixed(1)]) },
4661
+ duration: { value: this.formatDuration(squadStats.totalDuration), subtext: `${t("dota2tracker.template.report.daily.stats.avg_time")} ${this.formatDuration(squadStats.avgDuration)}` }
4662
+ },
4663
+ spotlights: {
4664
+ mvp: this.buildSpotlightCard(mvpPlayerData, "MVP", mvpStat.bestMatchId, extensions, dotaconstants, t, getHeroName, getImageUrl),
4665
+ lvp: this.buildSpotlightCard(lvpPlayerData, "LVP", lvpStat.worstMatchId, extensions, dotaconstants, t, getHeroName, getImageUrl)
4666
+ },
4667
+ squad: playerRows
4668
+ };
4669
+ bundles.push({ channelId, platform, report });
4670
+ }
4671
+ return bundles;
4672
+ }
4673
+ static groupUsersByChannel(users) {
4674
+ const groups = /* @__PURE__ */ new Map();
4675
+ for (const user of users) {
4676
+ const key = `${user.platform}:${user.guildId}`;
4677
+ if (!groups.has(key)) groups.set(key, []);
4678
+ groups.get(key).push(user);
4679
+ }
4680
+ return groups;
4681
+ }
4682
+ static calculateSquadStats(squadPlayerData, squadSteamIds, targetDate) {
4683
+ const targetSeconds = targetDate.toSeconds();
4684
+ const currentMatches = /* @__PURE__ */ new Map();
4685
+ const previousMatches = /* @__PURE__ */ new Map();
4686
+ for (const player of squadPlayerData) {
4687
+ for (const match of player.matches) {
4688
+ if (match.startDateTime >= targetSeconds) {
4689
+ currentMatches.set(match.id, match);
4690
+ } else {
4691
+ previousMatches.set(match.id, match);
4692
+ }
4693
+ }
4694
+ }
4695
+ const calcStats = /* @__PURE__ */ __name((matchesMap) => {
4696
+ const matchesArray = Array.from(matchesMap.values());
4697
+ const totalMatches = matchesArray.length;
4698
+ let totalWins = 0;
4699
+ let totalKills = 0;
4700
+ let totalDuration = 0;
4701
+ for (const match of matchesArray) {
4702
+ totalDuration += match.durationSeconds;
4703
+ const squadMembersInMatch = match.players.filter((p) => squadSteamIds.includes(p.steamAccount?.id));
4704
+ if (squadMembersInMatch.some((p) => p.isRadiant === match.didRadiantWin)) {
4705
+ totalWins += 1;
4706
+ }
4707
+ totalKills += squadMembersInMatch.reduce((sum, p) => sum + (p.kills || 0), 0);
4708
+ }
4709
+ return {
4710
+ totalMatches,
4711
+ totalWins,
4712
+ totalKills,
4713
+ totalDuration,
4714
+ winRate: totalMatches > 0 ? totalWins / totalMatches * 100 : 0,
4715
+ avgKills: totalMatches > 0 ? totalKills / totalMatches : 0,
4716
+ avgDuration: totalMatches > 0 ? totalDuration / totalMatches : 0
4717
+ };
4718
+ }, "calcStats");
4719
+ const currentStats = calcStats(currentMatches);
4720
+ const previousStats = calcStats(previousMatches);
4721
+ return {
4722
+ ...currentStats,
4723
+ winRateDiff: currentStats.winRate - previousStats.winRate
4724
+ };
4725
+ }
4726
+ static processPlayer(user, playerData, dotaconstants, targetDate, extensions, getImageUrl) {
4727
+ const targetSeconds = targetDate.toSeconds();
4728
+ let pWins = 0, pKills = 0, pDeaths = 0, pAssists = 0;
4729
+ let pHeroDamage = 0, pTowerDamage = 0, pNetworth = 0;
4730
+ let kdaSum = 0, mvpScoreSum = 0, bestScore = -1, worstScore = Infinity;
4731
+ let bestKda = -1, worstKda = Infinity;
4732
+ let bestMatchId = 0, worstMatchId = 0;
4733
+ const playedHeroes = /* @__PURE__ */ new Map();
4734
+ let processedMatchCount = 0;
4735
+ for (const m of playerData.matches) {
4736
+ if (m.startDateTime < targetSeconds) continue;
4737
+ processedMatchCount++;
4738
+ const self = m.players.find((p) => p.steamAccount?.id === user.steamId);
4739
+ if (self.isRadiant === m.didRadiantWin) pWins++;
4740
+ pKills += self.kills || 0;
4741
+ pDeaths += self.deaths || 0;
4742
+ pAssists += self.assists || 0;
4743
+ pHeroDamage += self.heroDamage || 0;
4744
+ pTowerDamage += self.towerDamage || 0;
4745
+ pNetworth += self.networth || 0;
4746
+ const matchKda = ((self.kills || 0) + (self.assists || 0)) / Math.max(1, self.deaths || 0);
4747
+ kdaSum += matchKda;
4748
+ const extension = extensions.find((e) => Number(e.matchId) === Number(m.id));
4749
+ const playerExtension = extension?.data?.players?.find((p) => p.steamAccountId === user.steamId);
4750
+ const mvpScore = playerExtension?.mvpScore || 0;
4751
+ mvpScoreSum += mvpScore;
4752
+ if (mvpScore > bestScore || mvpScore === bestScore && matchKda > bestKda) {
4753
+ bestScore = mvpScore;
4754
+ bestKda = matchKda;
4755
+ bestMatchId = m.id;
4756
+ }
4757
+ if (mvpScore < worstScore || mvpScore === worstScore && matchKda < worstKda) {
4758
+ worstScore = mvpScore;
4759
+ worstKda = matchKda;
4760
+ worstMatchId = m.id;
4761
+ }
4762
+ const current = playedHeroes.get(self.heroId) || { count: 0, wins: 0 };
4763
+ current.count++;
4764
+ if (self.isRadiant === m.didRadiantWin) current.wins++;
4765
+ playedHeroes.set(self.heroId, current);
4766
+ }
4767
+ const matchCount = processedMatchCount;
4768
+ const sortedHeroes = Array.from(playedHeroes.entries()).sort((a, b) => b[1].wins - a[1].wins || a[1].count - b[1].count);
4769
+ const row = {
4770
+ rank: 0,
4771
+ player: {
4772
+ name: user.nickName || playerData.steamAccount.name || "Unknown",
4773
+ avatarUrl: playerData.steamAccount.avatar || "",
4774
+ winCount: pWins,
4775
+ loseCount: matchCount - pWins
4776
+ },
4777
+ heroes: sortedHeroes.slice(0, 3).map(([heroId, stats]) => {
4778
+ const hero = dotaconstants.heroes[heroId];
4779
+ return {
4780
+ url: hero ? getImageUrl(hero.name.replace("npc_dota_hero_", ""), "heroes" /* Heroes */) : "",
4781
+ wins: stats.wins,
4782
+ losses: stats.count - stats.wins
4783
+ };
4784
+ }),
4785
+ plusHeroesCount: Math.max(0, sortedHeroes.length - 3),
4786
+ kda: {
4787
+ ratio: pKills + pAssists === 0 ? "0.0" : ((pKills + pAssists) / Math.max(1, pDeaths)).toFixed(1),
4788
+ detail: matchCount > 0 ? `${(pKills / matchCount).toFixed(1)} / ${(pDeaths / matchCount).toFixed(1)} / ${(pAssists / matchCount).toFixed(1)}` : "0.0/0.0/0.0"
4789
+ },
4790
+ impact: {
4791
+ damage: { heroPercent: 0, buildingsPercent: 0 },
4792
+ networth: { percent: 0 }
4793
+ }
4794
+ };
4795
+ return {
4796
+ row,
4797
+ stats: {
4798
+ steamId: user.steamId,
4799
+ avgKda: matchCount > 0 ? kdaSum / matchCount : 0,
4800
+ maxMvpScore: bestScore,
4801
+ // Use bestScore as maxMvpScore
4802
+ bestMatchId,
4803
+ worstMatchId
4804
+ },
4805
+ impact: { heroDamage: pHeroDamage, towerDamage: pTowerDamage, networth: pNetworth, matchCount, row }
4806
+ };
4807
+ }
4808
+ static calculateImpactPercentages(impactData) {
4809
+ let maxAvgTotalDamage = 0;
4810
+ let maxAvgNetworth = 0;
4811
+ for (const data of impactData) {
4812
+ const avgTotalDamage = (data.heroDamage + data.towerDamage) / data.matchCount;
4813
+ const avgNetworth = data.networth / data.matchCount;
4814
+ if (avgTotalDamage > maxAvgTotalDamage) maxAvgTotalDamage = avgTotalDamage;
4815
+ if (avgNetworth > maxAvgNetworth) maxAvgNetworth = avgNetworth;
4816
+ }
4817
+ for (const data of impactData) {
4818
+ const avgHeroDamage = data.heroDamage / data.matchCount;
4819
+ const avgTowerDamage = data.towerDamage / data.matchCount;
4820
+ const avgNetworth = data.networth / data.matchCount;
4821
+ const heroPercent = maxAvgTotalDamage > 0 ? Math.round(avgHeroDamage / maxAvgTotalDamage * 100) : 0;
4822
+ const buildingsPercent = maxAvgTotalDamage > 0 ? Math.round(avgTowerDamage / maxAvgTotalDamage * 100) : 0;
4823
+ data.row.impact.damage.heroPercent = Math.min(100, heroPercent);
4824
+ data.row.impact.damage.buildingsPercent = Math.min(100 - data.row.impact.damage.heroPercent, buildingsPercent);
4825
+ data.row.impact.networth.percent = maxAvgNetworth > 0 ? Math.round(avgNetworth / maxAvgNetworth * 100) : 0;
4826
+ }
4827
+ }
4828
+ static formatDuration(seconds) {
4829
+ const mins = Math.floor(seconds / 60);
4830
+ const secs = Math.floor(seconds % 60);
4831
+ return `${mins}:${secs.toString().padStart(2, "0")}`;
4832
+ }
4833
+ static buildSpotlightCard(playerData, type, matchId, extensions, dotaconstants, t, getHeroName, getImageUrl) {
4834
+ const match = playerData.matches.find((m) => m.id === matchId);
4835
+ const self = match.players.find((p) => p.steamAccount?.id === playerData.steamAccount.id);
4836
+ const extension = extensions.find((e) => Number(e.matchId) === Number(matchId));
4837
+ const playerExtension = extension?.data?.players?.find((p) => p.steamAccountId === playerData.steamAccount.id);
4838
+ const badgeKeys = playerExtension?.titles || [];
4839
+ const mvpScore = playerExtension?.mvpScore || 0;
4840
+ const matchKda = ((self.kills || 0) + (self.assists || 0)) / Math.max(1, self.deaths || 0);
4841
+ return {
4842
+ type,
4843
+ player: {
4844
+ name: playerData.steamAccount.name || "Unknown",
4845
+ heroName: getHeroName(self.heroId),
4846
+ kda: `${self.kills || 0} / ${self.deaths || 0} / ${self.assists || 0} (${matchKda.toFixed(1)})`,
4847
+ heroBannerUrl: dotaconstants.heroes[self.heroId] ? getImageUrl(dotaconstants.heroes[self.heroId].name.replace("npc_dota_hero_", ""), "heroes" /* Heroes */, "png" /* png */) : "",
4848
+ avatarUrl: playerData.steamAccount.avatar || ""
4849
+ },
4850
+ score: {
4851
+ value: mvpScore ? mvpScore.toFixed(1) : "-",
4852
+ label: t("dota2tracker.template.report.daily.spotlight.score_label")
4853
+ },
4854
+ badges: badgeKeys.map((key) => {
4855
+ const translated = t(key);
4856
+ const [text, hexColor] = translated.split("-#");
4857
+ return { text: text || key, hexColor: hexColor ? `#${hexColor}` : "#FFA500" };
4858
+ })
4859
+ };
4337
4860
  }
4338
4861
  };
4339
4862
 
4340
4863
  // src/config.ts
4341
- var import_koishi18 = require("koishi");
4342
- var import_fs3 = __toESM(require("fs"));
4343
- var import_path3 = __toESM(require("path"));
4864
+ var import_koishi19 = require("koishi");
4865
+ var import_node_fs4 = __toESM(require("node:fs"));
4866
+ var import_node_path4 = __toESM(require("node:path"));
4344
4867
 
4345
4868
  // require("./locales/**/*.schema.yml") in src/config.ts
4346
4869
  var globRequire_locales_schema_yml = __glob({
@@ -4349,81 +4872,88 @@ var globRequire_locales_schema_yml = __glob({
4349
4872
  });
4350
4873
 
4351
4874
  // src/config.ts
4352
- var templateDir = import_path3.default.join(__dirname, "templates");
4875
+ var templateDir = import_node_path4.default.join(__dirname, "templates");
4353
4876
  var allI18nConfigs = Object.fromEntries(Object.keys(LanguageTags).map((lang) => [lang, globRequire_locales_schema_yml(`./locales/${lang}.schema.yml`)._config]));
4354
- var Config = import_koishi18.Schema.intersect([
4355
- import_koishi18.Schema.intersect([
4356
- import_koishi18.Schema.object({
4357
- STRATZ_API_TOKEN: import_koishi18.Schema.string().required().role("secret"),
4358
- dataParsingTimeoutMinutes: import_koishi18.Schema.number().default(60).min(0).max(1440),
4359
- proxyAddress: import_koishi18.Schema.string(),
4360
- suppressApiNetworkErrors: import_koishi18.Schema.boolean().default(false),
4361
- enableOpenDotaFallback: import_koishi18.Schema.boolean().default(false)
4877
+ var Config = import_koishi19.Schema.intersect([
4878
+ import_koishi19.Schema.intersect([
4879
+ import_koishi19.Schema.object({
4880
+ STRATZ_API_TOKEN: import_koishi19.Schema.string().required().role("secret"),
4881
+ dataParsingTimeoutMinutes: import_koishi19.Schema.number().default(60).min(0).max(1440),
4882
+ proxyAddress: import_koishi19.Schema.string(),
4883
+ suppressApiNetworkErrors: import_koishi19.Schema.boolean().default(false),
4884
+ enableOpenDotaFallback: import_koishi19.Schema.boolean().default(false)
4362
4885
  }).i18n(getI18n("base")),
4363
- import_koishi18.Schema.union([
4364
- import_koishi18.Schema.object({
4365
- enableOpenDotaFallback: import_koishi18.Schema.const(true).required(),
4366
- OPENDOTA_API_KEY: import_koishi18.Schema.string().role("secret"),
4367
- OpenDotaIPStack: import_koishi18.Schema.union(["auto", "ipv4"]).default("auto")
4886
+ import_koishi19.Schema.union([
4887
+ import_koishi19.Schema.object({
4888
+ enableOpenDotaFallback: import_koishi19.Schema.const(true).required(),
4889
+ OPENDOTA_API_KEY: import_koishi19.Schema.string().role("secret"),
4890
+ OpenDotaIPStack: import_koishi19.Schema.union(["auto", "ipv4"]).default("auto")
4368
4891
  }),
4369
- import_koishi18.Schema.object({})
4892
+ import_koishi19.Schema.object({})
4370
4893
  ]).i18n(getI18n("base"))
4371
4894
  ]),
4372
- import_koishi18.Schema.intersect([
4373
- import_koishi18.Schema.object({
4374
- useHeroNicknames: import_koishi18.Schema.boolean().default(true),
4375
- urlInMessageType: import_koishi18.Schema.array(import_koishi18.Schema.union([import_koishi18.Schema.const("match"), import_koishi18.Schema.const("player"), import_koishi18.Schema.const("hero")])).role("checkbox"),
4376
- maxSendItemCount: import_koishi18.Schema.number().default(5).min(1).max(10),
4377
- showItemListAtTooMuchItems: import_koishi18.Schema.boolean().default(true),
4378
- customItemAlias: import_koishi18.Schema.array(
4379
- import_koishi18.Schema.object({
4380
- keyword: import_koishi18.Schema.string().required(),
4381
- alias: import_koishi18.Schema.string().required()
4895
+ import_koishi19.Schema.intersect([
4896
+ import_koishi19.Schema.object({
4897
+ useHeroNicknames: import_koishi19.Schema.boolean().default(true),
4898
+ urlInMessageType: import_koishi19.Schema.array(import_koishi19.Schema.union([import_koishi19.Schema.const("match"), import_koishi19.Schema.const("player"), import_koishi19.Schema.const("hero")])).role("checkbox"),
4899
+ maxSendItemCount: import_koishi19.Schema.number().default(5).min(1).max(10),
4900
+ showItemListAtTooMuchItems: import_koishi19.Schema.boolean().default(true),
4901
+ customItemAlias: import_koishi19.Schema.array(
4902
+ import_koishi19.Schema.object({
4903
+ keyword: import_koishi19.Schema.string().required(),
4904
+ alias: import_koishi19.Schema.string().required()
4382
4905
  })
4383
4906
  ).default([]).role("table"),
4384
- autoRecallTips: import_koishi18.Schema.boolean().default(true),
4385
- rankBroadSwitch: import_koishi18.Schema.boolean().default(false)
4907
+ autoRecallTips: import_koishi19.Schema.boolean().default(true),
4908
+ rankBroadSwitch: import_koishi19.Schema.boolean().default(false)
4386
4909
  }).i18n(getI18n("message")),
4387
- import_koishi18.Schema.union([
4388
- import_koishi18.Schema.object({
4389
- rankBroadSwitch: import_koishi18.Schema.const(true).required(),
4390
- rankBroadStar: import_koishi18.Schema.boolean().default(true),
4391
- rankBroadLeader: import_koishi18.Schema.boolean().default(true),
4392
- rankBroadFun: import_koishi18.Schema.boolean().default(false)
4910
+ import_koishi19.Schema.union([
4911
+ import_koishi19.Schema.object({
4912
+ rankBroadSwitch: import_koishi19.Schema.const(true).required(),
4913
+ rankBroadStar: import_koishi19.Schema.boolean().default(true),
4914
+ rankBroadLeader: import_koishi19.Schema.boolean().default(true),
4915
+ rankBroadFun: import_koishi19.Schema.boolean().default(false)
4393
4916
  }),
4394
- import_koishi18.Schema.object({})
4917
+ import_koishi19.Schema.object({})
4395
4918
  ]).i18n(getI18n("message"))
4396
4919
  ]),
4397
- import_koishi18.Schema.intersect([
4398
- import_koishi18.Schema.object({
4399
- dailyReportSwitch: import_koishi18.Schema.boolean().default(false)
4920
+ import_koishi19.Schema.intersect([
4921
+ import_koishi19.Schema.object({
4922
+ dailyReportSwitch: import_koishi19.Schema.boolean().default(false)
4400
4923
  }).i18n(getI18n("report")),
4401
- import_koishi18.Schema.union([
4402
- import_koishi18.Schema.object({
4403
- dailyReportSwitch: import_koishi18.Schema.const(true).required(),
4404
- dailyReportHours: import_koishi18.Schema.number().min(0).max(23).default(6),
4405
- dailyReportShowCombi: import_koishi18.Schema.boolean().default(true)
4924
+ import_koishi19.Schema.union([
4925
+ import_koishi19.Schema.object({
4926
+ dailyReportSwitch: import_koishi19.Schema.const(true).required(),
4927
+ dailyReportHours: import_koishi19.Schema.number().min(0).max(23).default(6),
4928
+ dailyReportShowCombi: import_koishi19.Schema.boolean().default(true).deprecated()
4406
4929
  }),
4407
- import_koishi18.Schema.object({})
4930
+ import_koishi19.Schema.object({})
4408
4931
  ]).i18n(getI18n("report")),
4409
- import_koishi18.Schema.object({
4410
- weeklyReportSwitch: import_koishi18.Schema.boolean().default(false)
4932
+ import_koishi19.Schema.object({
4933
+ weeklyReportSwitch: import_koishi19.Schema.boolean().default(false)
4411
4934
  }).i18n(getI18n("report")).description(void 0),
4412
- import_koishi18.Schema.union([
4413
- import_koishi18.Schema.object({
4414
- weeklyReportSwitch: import_koishi18.Schema.const(true).required(),
4415
- weeklyReportDayHours: import_koishi18.Schema.tuple([import_koishi18.Schema.number().min(1).max(7), import_koishi18.Schema.number().min(0).max(23)]).default([1, 10]),
4416
- weeklyReportShowCombi: import_koishi18.Schema.boolean().default(true)
4935
+ import_koishi19.Schema.union([
4936
+ import_koishi19.Schema.object({
4937
+ weeklyReportSwitch: import_koishi19.Schema.const(true).required(),
4938
+ weeklyReportDayHours: import_koishi19.Schema.tuple([import_koishi19.Schema.number().min(1).max(7), import_koishi19.Schema.number().min(0).max(23)]).default([1, 10]),
4939
+ weeklyReportShowCombi: import_koishi19.Schema.boolean().default(true)
4417
4940
  }),
4418
- import_koishi18.Schema.object({})
4941
+ import_koishi19.Schema.object({})
4419
4942
  ]).i18n(getI18n("report"))
4420
4943
  ]),
4421
- import_koishi18.Schema.object({
4422
- template_match: import_koishi18.Schema.union([...readDirectoryFilesSync(import_path3.default.join(templateDir, "match"))]).default("match_1"),
4423
- template_player: import_koishi18.Schema.union([...readDirectoryFilesSync(import_path3.default.join(templateDir, "player"))]).default("player_1"),
4424
- template_hero: import_koishi18.Schema.union([...readDirectoryFilesSync(import_path3.default.join(templateDir, "hero"))]).default("hero_1"),
4425
- playerRankEstimate: import_koishi18.Schema.boolean().default(true),
4426
- templateFonts: import_koishi18.Schema.array(String).default([]).role("table")
4944
+ import_koishi19.Schema.object({
4945
+ template_match: import_koishi19.Schema.union([...readDirectoryFilesSync(import_node_path4.default.join(templateDir, "match"))]).default("match_1"),
4946
+ template_player: import_koishi19.Schema.union([...readDirectoryFilesSync(import_node_path4.default.join(templateDir, "player"))]).default("player_1"),
4947
+ template_hero: import_koishi19.Schema.union([...readDirectoryFilesSync(import_node_path4.default.join(templateDir, "hero"))]).default("hero_1"),
4948
+ playerRankEstimate: import_koishi19.Schema.boolean().default(true),
4949
+ templateFonts: import_koishi19.Schema.array(String).default([]).role("table").deprecated(),
4950
+ fontPath: import_koishi19.Schema.path({ filters: ["directory"] }).default("data/fonts/dota2tracker"),
4951
+ fonts: import_koishi19.Schema.object({
4952
+ description: import_koishi19.Schema.never(),
4953
+ sans: import_koishi19.Schema.array(import_koishi19.Schema.dynamic("dota2tracker.fonts")).collapse(),
4954
+ serif: import_koishi19.Schema.array(import_koishi19.Schema.dynamic("dota2tracker.fonts")).collapse(),
4955
+ mono: import_koishi19.Schema.array(import_koishi19.Schema.dynamic("dota2tracker.fonts")).collapse()
4956
+ })
4427
4957
  }).i18n(getI18n("template"))
4428
4958
  ]);
4429
4959
  function getI18n(key) {
@@ -4438,8 +4968,8 @@ function getI18n(key) {
4438
4968
  __name(getI18n, "getI18n");
4439
4969
  function readDirectoryFilesSync(directoryPath) {
4440
4970
  try {
4441
- const files = import_fs3.default.readdirSync(directoryPath);
4442
- const fileNames = files.filter((file) => import_path3.default.extname(file).toLowerCase() === ".ejs").map((file) => import_path3.default.basename(file, ".ejs"));
4971
+ const files = import_node_fs4.default.readdirSync(directoryPath);
4972
+ const fileNames = files.filter((file) => import_node_path4.default.extname(file).toLowerCase() === ".ejs").map((file) => import_node_path4.default.basename(file, ".ejs"));
4443
4973
  return fileNames;
4444
4974
  } catch (error) {
4445
4975
  console.error("Error reading directory:", error);
@@ -4453,14 +4983,14 @@ var name = "dota2tracker";
4453
4983
  var usage = "";
4454
4984
  var inject = {
4455
4985
  required: ["database", "puppeteer", "cache"],
4456
- optional: ["cron", "console"]
4986
+ optional: ["cron"]
4457
4987
  };
4458
4988
  async function apply(ctx, config) {
4459
4989
  const lib = await import("dotaconstants");
4460
4990
  const dotaconstants = lib.default || lib;
4461
4991
  const logger = ctx.logger("dota2tracker");
4462
- const currentDir = import_path4.default.resolve(__dirname);
4463
- const pluginVersion = require(import_path4.default.join(currentDir, "..", "package.json")).version;
4992
+ const currentDir = import_node_path5.default.resolve(__dirname);
4993
+ const pluginVersion = require(import_node_path5.default.join(currentDir, "..", "package.json")).version;
4464
4994
  ctx.dota2tracker = {};
4465
4995
  ctx.dota2tracker.dotaconstants = dotaconstants;
4466
4996
  ctx.dota2tracker.i18n = new I18NService(ctx);
@@ -4490,6 +5020,7 @@ async function apply(ctx, config) {
4490
5020
  ctx.dota2tracker.opendotaAPI = new OpenDotaAPI(ctx);
4491
5021
  ctx.dota2tracker.opendotaAdapter = new OpenDotaAdapter(ctx);
4492
5022
  }
5023
+ ctx.dota2tracker.font = new FontService(ctx);
4493
5024
  ctx.dota2tracker = ctx.dota2tracker;
4494
5025
  usage = await ctx.dota2tracker.i18n.generateUsage();
4495
5026
  registerHelpCommand(ctx);