@sjtdev/koishi-plugin-dota2tracker 2.3.2 → 2.3.4

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
@@ -768,14 +768,14 @@ var require_zh_CN_constants = __commonJS({
768
768
  // src/locales/en-US.command.yml
769
769
  var require_en_US_command = __commonJS({
770
770
  "src/locales/en-US.command.yml"(exports2, module2) {
771
- module2.exports = { commands: { dota2tracker: { description: 'A series of commands for Dota 2 Tracker. Use "dota2tracker -h" to see all available commands.', subscribe: { description: "Subscribes the current channel to Dota 2 match tracking.", usage: "After subscribing, players need to bind their Steam ID in this channel. The bot will then track new matches of bound players and post image-based reports upon completion of parsing by Stratz.", examples: "subscribe", messages: { subscribe_success: "Subscription successful.", subscribed: "This Channel has been subscribed, no need to subscribe again." } }, unsubscribe: { description: "Unsubscribes the current channel from match tracking.", usage: "Unsubscribes the current channel from match tracking.", examples: "unsubscribe", messages: { unsubscribe_success: "Unsubscription successful.", not_subscribed: "This Channel has not been subscribed yet, so there is no need to unsubscribe." } }, bind: { description: "Binds your SteamID to your account in the current channel.", usage: 'Bind your SteamID to your account. If the channel is subscribed, your new match data will be posted automatically. Nicknames containing spaces must be enclosed in double quotes ("").', examples: 'bind 123456789\nbind 123456789 John\nbind 123456789 "John Doe"', messages: { steam_id_invalid: "Invalid SteamID.", bind_success: "Binding successful,\nID: {userId}\nNickname: {nickName}\nSteamID: {steamId}", bind_failed: "Binding failed, {0}", reason_without_match: "Invalid SteamID or no matches found.", reason_fetch_failed: "Poor network conditions or other reasons prevented the verification of the SteamID. Please try again later.", already_binded: "You are already bound, no need to bind again.\nHere is your personal information:\nID: {userId}\nNickname: {nickName}\nSteamID: {steamId}", nick_name_too_long: "Nickname is too long, please limit it to 20 characters or less. (It can also be left blank)", is_anonymous: 'Please note: Your Steam player data is not public, and you will not be able to use the main functions of the BOT, such as "battle report tracking," "query-recent-match commands," etc.\nIf you need to make data public, please set it to public in the DOTA2 game settings.' } }, unbind: { description: "Unbinds your personal information in the current channel.", usage: "Unbind your personal information in the current channel.", examples: "unbind", messages: { unbind_success: "Unbinding successful.", not_binded: "Not bound, no need to unbind." } }, rename: { description: "Changes the nickname set during binding.", usage: 'Change the nickname set during binding. Nicknames containing spaces must be enclosed in double quotes ("").', examples: 'rename John\nrename "John Doe"', messages: { rename_success: "Rename successful, now you are called {nick_name}.", empty_input: "Please enter your nickname.", not_binded: "Please bind first, you can set a nickname during binding.", nick_name_too_long: "Nickname is too long, please limit it to 20 characters.", nick_name_same: "The input content is the same as the original nickname and does not need to be renamed." } }, "query-members": { description: "Queries the players bound in this channel and generates an info image.", usage: "Queries the players bound in this channel and generates an informational image.", examples: "query-members", messages: { title: "Guild DOTA 2 Roster (Total: {count})", table_headers: { nickname: "Nickname", winrate: "Win Rate (L10)", last_match: "Last Match" }, no_members: "No players bound in this group.", query_failed: "Failed to query group members." } }, "query-match": { description: "Query the match data of the specified match ID and generate a picture.", usage: "Query the match data of the specified match ID and generate a picture.", options: { parse: "Whether to wait for match data parsing" }, examples: "query-match 1234567890\nquery-match 1234567890 -p\nquery-match 1234567890 --parse", messages: { empty_input: "Please enter the match ID.", match_id_invalid: "Invalid match ID.", querying_match: "Searching for match details, please wait...", query_failed: "Failed to get match data.", waiting_for_parse: "Match data has not been parsed yet, a parse request has been sent to the server. The battle report will be sent once parsing is complete or times out." } }, "query-recent-match": { description: "Query the most recent match data and generate a picture.", options: { parse: "Whether to wait for match data parsing" }, usage: "Query the most recent match data of the specified player and generate a picture.\nThe parameter can be the player's SteamID or the nickname of a player bound in this group. If no parameter is provided, it will try to query the SteamID of the command caller.", examples: "query-recent-match\nquery-recent-match 123456789\nquery-recent-match John\nquery-recent-match 123456789 -p\nquery-recent-match John --parse", messages: { querying_match: "Searching for match details, please wait...", query_failed: "Failed to get the player's recent match.", is_anonymous: "Your player data is not public, and recent match data cannot be obtained.\nIf you need to make data public, please set it to public in the DOTA2 game settings." } }, "query-player": { description: "Query the player's personal information, optionally specify a hero.", options: { hero: "Query the player's usage of the specified hero (same as querying a hero, can use nickname or ID)" }, usage: "Query the personal information of the specified player and generate a picture, optionally specify a hero.\nThe parameter can be the player's SteamID or the nickname of a player bound in this group. If no parameter is provided, it will try to query the SteamID of the command caller.", examples: "query-player\nquery-player 123456789\nquery-player John\nquery-player John --hero Anti-Mage\nquery-player John -o Anti-Mage", messages: { querying_player: "Retrieving player data, please wait...", query_failed: "Failed to get player information." } }, "query-hero": { description: "Query hero skills/stats information.", options: { random: "Randomly select a hero." }, usage: "Query the hero's skill descriptions and various stats, generate a picture.\nThe parameter can be the hero's ID, name, or common nickname.", examples: "query-hero 15\nquery-hero Razor\nquery-hero -r", messages: { not_found: "Hero not found, please confirm and re-enter.", querying_hero: "Retrieving hero data, please wait...", query_failed: "Failed to get hero data.", empty_input: "Please enter a parameter." } }, "query-item": { description: "Query item information", usage: "Query item descriptions and attributes, then generate and publish an image report.\nParameters can be item name (supports fuzzy search), item alias, or item ID.\nYou can set the maximum number of items to send per query on the configuration page, as well as whether to send the item list when the limit is exceeded or parameters are not entered.", examples: "query-item Vanguard", messages: { query_list_failed: "Failed to retrieve item list data", query_item_failed: "Failed to retrieve data for item '{0}'", querying_item: "Querying item data, please wait...", cache_building: "Initializing or rebuilding item cache for the current version, please wait...", empty_input: "No keywords provided. \n{#if show}Displaying full item list per current configuration\n{:else}No content available\n{/if}", not_found: "No items found matching the keywords, please verify and retry", too_many_items: "Found {count} items, exceeding maximum display limit ({max} items)\n{#if show}(Displaying item list){/if}", finded_items: "Matching items: \n{#each items as item}\n{item.name_loc}{#if item !== items[items.length - 1]}, {/if}\n{/each}" } }, "hero-of-the-day": { description: "Get hero recommendations for the day.", usage: "Fetches recent and lifetime match history to recommend heroes based on parameters like wins, performance score, and hot streaks.\nThe parameter can be a player's SteamID or the nickname of a player bound in this group. If no parameter is provided, it will try to look up the command caller's SteamID.", options: { days: "-d <number> The range of recent days to consider, default is 30." }, examples: 'hero-of-the-day\nhero-of-the-day -d 60\nhero-of-the-day 1234567890\nhero-of-the-day "John Doe"', messages: { title_recommendation: "Today's Recommendation:", recommendation_intro: "The recommended heroes for you today are:", recommendation_heroes: "{#each heroes as hero}{hero}{#if hero !== heroes[heroes.length - 1]}, {/if}{/each}", recommendation_type_lifetime_only: "Your recent match history is empty. This recommendation is based on your lifetime statistics.", recommendation_type_no_record: "Recommendations cannot be generated due to a lack of recent and lifetime match data.", recommendation_type_anonymous: "Recommendations cannot be generated because your profile data is private.", details: { pool_description: "The recommendation is generated by scoring your recent and lifetime hero performance, sorting by total score, and then randomly selecting from the top 10 heroes weighted by their scores.", table_intro: "Below is the detailed score breakdown for the top 10 heroes.", table_headers: { hero: "Hero", recent_wins: "Recent Wins Score", lifetime_wins: "Lifetime Wins<br>(Logarithmic)", imp_bonus: "IMP Bonus", is_hot_streak: "Hot Streak", total_score: "Total Score" }, scoring_formula: "Current Scoring Formula: [Recent Wins x 1] + [log(Lifetime Wins + 1) x 5] + [Recent IMP x 0.1]", hot_streak_desc: "If a hero was played in the last 3 days, it's considered a 'Hot Streak' hero, receiving a 20% bonus to its total score." }, title_meta: "Meta Trends:", meta_intro: "Top 3 advantage heroes for each position with a <b>pick rate ≥2%</b> within ±1 of your rank bracket ({tiers}) over the last week, sorted by win rate:", meta_table_header: "Hero (Pick% Win%)", meta_position: "Pos {pos}:" } }, common: { messages: { user_not_binded_in_channel: "By default, it tries to find your information from the bound SteamID players, but it seems you are not bound.\nPlease bind your SteamID in this group. (You can enter [bind -h] for help)\nOr follow the command with the SteamID or nickname of the player you want to query.", user_not_in_group: "Command failed.\nCurrently not in a group chat, you must provide the specified player's SteamID.", invalid_input_include_steam_id: "Invalid SteamID and the player was not found in this group by the given input." } }, help: { description: "Get detailed information for all commands and the link to the online documentation.", usage: "Get detailed information for all commands and the link to the online documentation.", examples: "help", messages: { header: "Below is the full list of plugin commands.\n※Note: <arg> is a required argument, and [arg] is an optional argument. Please see the 'Examples' column for specific usage.", footer: "For more information on plugin configuration, template showcases, and other details, please visit the online documentation:\nhttps://sjtdev.github.io/koishi-plugin-dota2tracker/en-US/", table_headers: { command: "Command", alias: "Alias", arguments: "Arguments", description: "Description", options: "Options", examples: "Examples" } } } } } };
771
+ module2.exports = { commands: { dota2tracker: { description: "A series of commands for Dota 2 Tracker. Use dota2tracker -h to see all available commands, or use dota2tracker.help to see a detailed description of all commands.", subscribe: { description: "Subscribes the current channel to Dota 2 match tracking.", usage: "After subscribing, players need to bind their Steam ID in this channel. The bot will then track new matches of bound players and post image-based reports upon completion of parsing by Stratz.", examples: "subscribe", messages: { subscribe_success: "Subscription successful.", subscribed: "This Channel has been subscribed, no need to subscribe again." } }, unsubscribe: { description: "Unsubscribes the current channel from match tracking.", usage: "Unsubscribes the current channel from match tracking.", examples: "unsubscribe", messages: { unsubscribe_success: "Unsubscription successful.", not_subscribed: "This Channel has not been subscribed yet, so there is no need to unsubscribe." } }, bind: { description: "Binds your SteamID to your account in the current channel.", usage: 'Bind your SteamID to your account. If the channel is subscribed, your new match data will be posted automatically. Nicknames containing spaces must be enclosed in double quotes ("").', examples: 'bind 123456789\nbind 123456789 John\nbind 123456789 "John Doe"', messages: { steam_id_invalid: "Invalid SteamID.", bind_success: "Binding successful,\nID: {userId}\nNickname: {nickName}\nSteamID: {steamId}", bind_failed: "Binding failed, {0}", reason_without_match: "Invalid SteamID or no matches found.", reason_fetch_failed: "Poor network conditions or other reasons prevented the verification of the SteamID. Please try again later.", already_binded: "You are already bound, no need to bind again.\nHere is your personal information:\nID: {userId}\nNickname: {nickName}\nSteamID: {steamId}", nick_name_too_long: "Nickname is too long, please limit it to 20 characters or less. (It can also be left blank)", is_anonymous: 'Please note: Your Steam player data is not public, and you will not be able to use the main functions of the BOT, such as "battle report tracking," "query-recent-match commands," etc.\nIf you need to make data public, please set it to public in the DOTA2 game settings.' } }, unbind: { description: "Unbinds your personal information in the current channel.", usage: "Unbind your personal information in the current channel.", examples: "unbind", messages: { unbind_success: "Unbinding successful.", not_binded: "Not bound, no need to unbind." } }, rename: { description: "Changes the nickname set during binding.", usage: 'Change the nickname set during binding. Nicknames containing spaces must be enclosed in double quotes ("").', examples: 'rename John\nrename "John Doe"', messages: { rename_success: "Rename successful, now you are called {nick_name}.", empty_input: "Please enter your nickname.", not_binded: "Please bind first, you can set a nickname during binding.", nick_name_too_long: "Nickname is too long, please limit it to 20 characters.", nick_name_same: "The input content is the same as the original nickname and does not need to be renamed." } }, "query-members": { description: "Queries the players bound in this channel and generates an info image.", usage: "Queries the players bound in this channel and generates an informational image.", examples: "query-members", messages: { title: "Guild DOTA 2 Roster (Total: {count})", table_headers: { nickname: "Nickname", winrate: "Win Rate (L10)", last_match: "Last Match" }, no_members: "No players bound in this group.", query_failed: "Failed to query group members." } }, "query-match": { description: "Query the match data of the specified match ID and generate a picture.", usage: "Query the match data of the specified match ID and generate a picture.", options: { parse: "Whether to wait for match data parsing" }, examples: "query-match 1234567890\nquery-match 1234567890 -p\nquery-match 1234567890 --parse", messages: { empty_input: "Please enter the match ID.", match_id_invalid: "Invalid match ID.", querying_match: "Searching for match details, please wait...", query_failed: "Failed to get match data.", waiting_for_parse: "Match data has not been parsed yet, a parse request has been sent to the server. The battle report will be sent once parsing is complete or times out." } }, "query-recent-match": { description: "Query the most recent match data and generate a picture.", options: { parse: "Whether to wait for match data parsing" }, usage: "Query the most recent match data of the specified player and generate a picture.\nThe parameter can be the player's SteamID or the nickname of a player bound in this group. If no parameter is provided, it will try to query the SteamID of the command caller.", examples: "query-recent-match\nquery-recent-match 123456789\nquery-recent-match John\nquery-recent-match 123456789 -p\nquery-recent-match John --parse", messages: { querying_match: "Searching for match details, please wait...", query_failed: "Failed to get the player's recent match.", is_anonymous: "Your player data is not public, and recent match data cannot be obtained.\nIf you need to make data public, please set it to public in the DOTA2 game settings." } }, "query-player": { description: "Query the player's personal information, optionally specify a hero.", options: { hero: "Query the player's usage of the specified hero (same as querying a hero, can use nickname or ID)" }, usage: "Query the personal information of the specified player and generate a picture, optionally specify a hero.\nThe parameter can be the player's SteamID or the nickname of a player bound in this group. If no parameter is provided, it will try to query the SteamID of the command caller.", examples: "query-player\nquery-player 123456789\nquery-player John\nquery-player John --hero Anti-Mage\nquery-player John -o Anti-Mage", messages: { querying_player: "Retrieving player data, please wait...", query_failed: "Failed to get player information." } }, "query-hero": { description: "Query hero skills/stats information.", options: { random: "Randomly select a hero." }, usage: "Query the hero's skill descriptions and various stats, generate a picture.\nThe parameter can be the hero's ID, name, or common nickname.", examples: "query-hero 15\nquery-hero Razor\nquery-hero -r", messages: { not_found: "Hero not found, please confirm and re-enter.", querying_hero: "Retrieving hero data, please wait...", query_failed: "Failed to get hero data.", empty_input: "Please enter a parameter." } }, "query-item": { description: "Query item information", usage: "Query item descriptions and attributes, then generate and publish an image report.\nParameters can be item name (supports fuzzy search), item alias, or item ID.\nYou can set the maximum number of items to send per query on the configuration page, as well as whether to send the item list when the limit is exceeded or parameters are not entered.", examples: "query-item Vanguard", messages: { query_list_failed: "Failed to retrieve item list data", query_item_failed: "Failed to retrieve data for item '{0}'", querying_item: "Querying item data, please wait...", cache_building: "Initializing or rebuilding item cache for the current version, please wait...", empty_input: "No keywords provided. \n{#if show}Displaying full item list per current configuration\n{:else}No content available\n{/if}", not_found: "No items found matching the keywords, please verify and retry", too_many_items: "Found {count} items, exceeding maximum display limit ({max} items)\n{#if show}(Displaying item list){/if}", finded_items: "Matching items: \n{#each items as item}\n{item.name_loc}{#if item !== items[items.length - 1]}, {/if}\n{/each}" } }, "hero-of-the-day": { description: "Get hero recommendations for the day.", usage: "Fetches recent and lifetime match history to recommend heroes based on parameters like wins, performance score, and hot streaks.\nThe parameter can be a player's SteamID or the nickname of a player bound in this group. If no parameter is provided, it will try to look up the command caller's SteamID.", options: { days: "-d <number> The range of recent days to consider, default is 30." }, examples: 'hero-of-the-day\nhero-of-the-day -d 60\nhero-of-the-day 1234567890\nhero-of-the-day "John Doe"', messages: { title_recommendation: "Today's Recommendation:", recommendation_intro: "The recommended heroes for you today are:", recommendation_heroes: "{#each heroes as hero}{hero}{#if hero !== heroes[heroes.length - 1]}, {/if}{/each}", recommendation_type_lifetime_only: "Your recent match history is empty. This recommendation is based on your lifetime statistics.", recommendation_type_no_record: "Recommendations cannot be generated due to a lack of recent and lifetime match data.", recommendation_type_anonymous: "Recommendations cannot be generated because your profile data is private.", details: { pool_description: "The recommendation is generated by scoring your recent and lifetime hero performance, sorting by total score, and then randomly selecting from the top 10 heroes weighted by their scores.", table_intro: "Below is the detailed score breakdown for the top 10 heroes.", table_headers: { hero: "Hero", recent_wins: "Recent Wins Score", lifetime_wins: "Lifetime Wins<br>(Logarithmic)", imp_bonus: "IMP Bonus", is_hot_streak: "Hot Streak", total_score: "Total Score" }, scoring_formula: "Current Scoring Formula: [Recent Wins x 1] + [log(Lifetime Wins + 1) x 5] + [Recent IMP x 0.1]", hot_streak_desc: "If a hero was played in the last 3 days, it's considered a 'Hot Streak' hero, receiving a 20% bonus to its total score." }, title_meta: "Meta Trends:", meta_intro: "Top 3 advantage heroes for each position with a <b>pick rate ≥2%</b> within ±1 of your rank bracket ({tiers}) over the last week, sorted by win rate:", meta_table_header: "Hero (Pick% Win%)", meta_position: "Pos {pos}:", querying: "Retrieving player stats and hero win rates, please wait...", query_failed: "Command failed." } }, common: { messages: { user_not_binded_in_channel: "By default, it tries to find your information from the bound SteamID players, but it seems you are not bound.\nPlease bind your SteamID in this group. (You can enter [bind -h] for help)\nOr follow the command with the SteamID or nickname of the player you want to query.", user_not_in_group: "Command failed.\nCurrently not in a group chat, you must provide the specified player's SteamID.", invalid_input_include_steam_id: "Invalid SteamID and the player was not found in this group by the given input." } }, help: { description: "Get detailed information for all commands and the link to the online documentation.", usage: "Get detailed information for all commands and the link to the online documentation.", examples: "help", messages: { header: "Below is the full list of plugin commands.\n※Note: <arg> is a required argument, and [arg] is an optional argument. Please see the 'Examples' column for specific usage.", footer: "For more information on plugin configuration, template showcases, and other details, please visit the online documentation:\nhttps://sjtdev.github.io/koishi-plugin-dota2tracker/en-US/", table_headers: { command: "Command", alias: "Alias", arguments: "Arguments", description: "Description", options: "Options", examples: "Examples" } } } } } };
772
772
  }
773
773
  });
774
774
 
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" } }, 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](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)' } } };
779
779
  }
780
780
  });
781
781
 
@@ -796,14 +796,14 @@ var require_en_US = __commonJS({
796
796
  // src/locales/zh-CN.command.yml
797
797
  var require_zh_CN_command = __commonJS({
798
798
  "src/locales/zh-CN.command.yml"(exports2, module2) {
799
- module2.exports = { commands: { dota2tracker: { description: "dota2tracker的一系列指令,可以使用dota2tracker -h查看所有可用指令。", subscribe: { description: "[订阅本群]", usage: "订阅后还需玩家在本群绑定SteamID,BOT将订阅本群中已绑定玩家的新比赛数据,在STRATZ比赛解析完成后将比赛数据生成为图片战报发布至本群中。", examples: "订阅本群", messages: { subscribed: "本群已订阅,无需重复订阅。", subscribe_success: "订阅成功。" } }, unsubscribe: { description: "[取消订阅] 取消订阅本群。", usage: "取消订阅本群。", examples: "取消订阅", messages: { unsubscribe_success: "取消订阅成功。", not_subscribed: "本群尚未订阅,无需取消订阅。" } }, bind: { description: "[绑定] 绑定SteamID,并起一个别名(也可以不起)。", usage: '将你的SteamID与你的账号绑定,若本群已订阅将会实时获取你的新比赛数据发布至群中。名称中含有空格时需要使用""引号包裹(英文半角引号)。', examples: '绑定 123456789\n绑定 123456789 张三\n绑定 123456789 "张 三"', messages: { steam_id_invalid: "SteamID无效。", bind_success: "绑定成功,\nID:{userId}\n别名:{nickName}\nSteamID:{steamId}", bind_failed: "绑定失败,{0}", reason_without_match: "SteamID无效或无任何场次。", reason_fetch_failed: "网络状况不佳或其他原因无法验证SteamID,请稍后重试。", already_binded: "你已绑定,无需重复绑定。\n以下是你的个人信息:\nID:{userId}\n别名:{nickName}\nSteamID:{steamId}", nick_name_too_long: "别名过长,请限制在20个字符以内。(也可以留空)", is_anonymous: "请注意:你的Steam玩家数据并未公开,将无法使用BOT的主要功能,如“战报追踪”、“查询最近指令”等。\n如需公开数据,请在DOTA2游戏内设置中公开。" } }, unbind: { description: "[取消绑定] 取消绑定你的个人信息。", usage: "取消绑定你的个人信息。", examples: "取消绑定", messages: { unbind_success: "取消绑定成功。", not_binded: "尚未绑定,无需取消绑定。" } }, rename: { description: "[改名] 修改绑定时设定的别名。", usage: '修改绑定时设定的别名。名称中含有空格时需要使用""引号包裹(英文半角引号)。', examples: '改名 李四\n改名 "李 四"', messages: { rename_success: "改名成功,现在你叫{nick_name}了。", empty_input: "请输入你的别名。", not_binded: "请先绑定,绑定时即可设定别名。", nick_name_too_long: "别名过长,请限制在20个字符以内。", nick_name_same: "目标别名与原始别名相同,无需改名。" } }, "query-members": { description: "[查询群友] 查询本群已绑定的玩家。", usage: "查询本群已绑定的玩家,生成简单信息图片发布。", examples: "查询群友", messages: { title: "本群 DOTA2 玩家名册 (共 {count} 人)", table_headers: { nickname: "昵称/别名", winrate: "胜率 (近10场)", last_match: "最近比赛" }, no_members: "本群尚无绑定玩家。", query_failed: "查询群友失败。" } }, "query-match": { description: "[查询比赛] 查询指定比赛ID的比赛数据,生成图片发布。", usage: "查询指定MatchID的比赛数据,生成图片发布。", options: { parse: "-p 是否等待解析比赛数据" }, examples: "查询比赛 1234567890\n查询比赛 1234567890 -p\n查询比赛 1234567890 --parse", messages: { empty_input: "请输入比赛ID。", match_id_invalid: "比赛ID无效。", querying_match: "正在搜索对局详情,请稍后……", query_failed: "获取比赛数据失败。", waiting_for_parse: "比赛数据尚未解析,已发送解析请求到服务器,战报将在解析完成或超时后发送。" } }, "query-recent-match": { description: "[查询最近比赛] 查询最近的比赛数据,生成图片发布。", options: { parse: "-p 是否等待解析比赛数据" }, usage: "查询指定玩家的最近一场比赛的比赛数据,生成图片发布。\n参数可输入该玩家的SteamID或已在本群绑定玩家的别名,无参数时尝试查询调用指令玩家的SteamID。", examples: "查询最近比赛\n查询最近比赛 123456789\n查询最近比赛 张三\n查询最近比赛 123456789 -p\n查询最近比赛 张三 --parse", messages: { querying_match: "正在搜索对局详情,请稍后……", query_failed: "获取玩家最近比赛失败。", not_in_group: "指令调用失败。\n当前不属于群聊状态,必须提供指定玩家的SteamID。", is_anonymous: "你的比赛数据未公开,无法获取最近比赛数据。\n如需公开数据,请在DOTA2游戏内设置中公开。" } }, "query-player": { description: "[查询玩家] 查询玩家的个人信息,可指定英雄。", options: { hero: "-o 查询玩家指定英雄使用情况(同查询英雄,可用别名或ID)" }, usage: "查询指定玩家的个人信息,生成图片发布,可指定英雄。\n参数可输入该玩家的SteamID或已在本群绑定玩家的别名,无参数时尝试查询调用指令玩家的SteamID。", examples: "查询玩家\n查询玩家 123456789\n查询玩家 张三\n查询玩家 张三 --hero 敌法师\n查询玩家 张三 -o 15", messages: { querying_player: "正在获取玩家数据,请稍后……", query_failed: "获取玩家信息失败。", not_in_group: "指令调用失败。\n当前不属于群聊状态,必须提供指定玩家的SteamID。" } }, "query-hero": { description: "[查询英雄] 查询英雄技能/面板信息。", options: { random: "-r 随机选择英雄" }, usage: "查询英雄的技能说明与各项数据,生成图片发布。\n参数可输入英雄ID、英雄名、英雄常用别名。", examples: "查询英雄 15\n查询英雄 雷泽\n查询英雄 电魂\n查询英雄 -r", messages: { not_found: "未找到输入的英雄,请确认后重新输入。", querying_hero: "正在获取英雄数据,请稍后……", query_failed: "获取英雄数据失败。", empty_input: "请输入参数。" } }, "query-item": { description: "[查询物品] 查询物品信息。", usage: "查询物品的描述与各项数据,生成图片发布。\n参数可输入物品名(可模糊查找)、物品别名、物品ID。\n可在配置页中设置每次查询的最大发送数量、以及是否在超过限制或未输入参数时发送物品列表。", examples: "查询物品 先锋盾", messages: { query_list_failed: "获取物品列表数据失败。", query_item_failed: "获取物品「{0}」数据失败", querying_item: "正在查询物品数据,请稍候…", cache_building: "初次使用或缓存已过期,正在生成当前版本的物品缓存,请稍后……", empty_input: "未输入关键字参数。根据当前配置{#if show},将返回全部物品列表{:else}无内容可发送{/if}。", not_found: "未找到与关键字匹配的物品,请确认后重试。", too_many_items: "找到{count}个物品,超过最大发送限制({max}个){#if show},将发送物品列表{/if}。", finded_items: "找到以下物品:{#each items as item}{item.name_loc}{#if item !== items[items.length - 1]}、{/if}{/each}" } }, "hero-of-the-day": { description: "[今日英雄] 获取今日英雄推荐。", usage: "获取近期比赛记录、生涯比赛记录,根据胜场、表现分、是否手热等参数计算推荐英雄。\n参数可输入该玩家的SteamID或已在本群绑定玩家的别名,无参数时尝试查询调用指令玩家的SteamID。", options: { days: "-d <number> 近期数据的获取范围,单位为天数,默认值为30" }, examples: "今日英雄\n今日英雄 -d 60\n今日英雄 1234567890\n今日英雄 张三", messages: { title_recommendation: "今日推荐:", recommendation_intro: "今日为您推荐的英雄是:", recommendation_heroes: "{#each heroes as hero}{hero}{#if hero !== heroes[heroes.length - 1]}、{/if}{/each}", recommendation_type_lifetime_only: "您的近期数据为空,本次推荐结果基于您的生涯数据。", recommendation_type_no_record: "您的近期与生涯数据为空,无法生成推荐信息。", recommendation_type_anonymous: "您的个人数据未公开,无法生成推荐信息。", details: { pool_description: "推荐结果根据对您的近期与生涯英雄使用记录计分后,按总分排序后对前10位英雄以分数为权重随机取得。", table_intro: "以下是前10位英雄具体得分表。", table_headers: { hero: "英雄名称", recent_wins: "近期胜场分", lifetime_wins: "生涯胜场分<br>(对数)", imp_bonus: "imp奖励分", is_hot_streak: "是否手热", total_score: "总分" }, scoring_formula: "当前计分规则:[近期胜场数 x 1] + [log(生涯胜场数+1) x 5] + [近期imp x 0.1]", hot_streak_desc: "若英雄在3天内使用过,则记为手热英雄,总分提升20%。" }, title_meta: "环境趋势:", meta_intro: "一周内,基于您段位±1 ({tiers}) 范围内各位置<b>选择率≥2%</b>按胜率从高到低前三名优势英雄:", meta_table_header: "英雄名称(选择率% 胜率%)", meta_position: "{pos}号位:" } }, common: { messages: { user_not_binded_in_channel: "无参数时默认从已绑定SteamID玩家中寻找你的信息,但你似乎并没有绑定。\n请在本群绑定SteamID。(可输入【绑定 -h】获取帮助)\n或在指令后跟上希望查询的SteamID或已绑定玩家的别名。", user_not_in_group: "指令调用失败。\n当前不属于群聊状态,必须提供指定玩家的SteamID。", invalid_input_include_steam_id: "SteamID无效并且未在本群根据输入信息找到玩家。" } }, help: { description: "[DOTA2指南] 获取插件的全部指令详细信息与在线文档链接。", usage: "获取插件的全部指令详细信息与在线文档链接。", examples: "DOTA2指南\nDOTA2帮助\nDOTA2说明", messages: { header: "以下是插件的全部指令。\n※注意 <arg> 是必须参数,[arg] 是可选参数,具体使用方法请看“用法示例”列。", footer: "插件配置、模板展示等更多信息请访问在线文档:\nhttps://sjtdev.github.io/koishi-plugin-dota2tracker/", table_headers: { command: "指令名", alias: "指令中文", arguments: "参数", description: "说明", options: "选项", examples: "用法示例" } } } } } };
799
+ module2.exports = { commands: { dota2tracker: { description: "dota2tracker的一系列指令,可以使用dota2tracker -h查看所有可用指令,或者使用`dota2tracker.help`(默认别名`DOTA2帮助`)查看所有指令详细说明表。", subscribe: { description: "[订阅本群]", usage: "订阅后还需玩家在本群绑定SteamID,BOT将订阅本群中已绑定玩家的新比赛数据,在STRATZ比赛解析完成后将比赛数据生成为图片战报发布至本群中。", examples: "订阅本群", messages: { subscribed: "本群已订阅,无需重复订阅。", subscribe_success: "订阅成功。" } }, unsubscribe: { description: "[取消订阅] 取消订阅本群。", usage: "取消订阅本群。", examples: "取消订阅", messages: { unsubscribe_success: "取消订阅成功。", not_subscribed: "本群尚未订阅,无需取消订阅。" } }, bind: { description: "[绑定] 绑定SteamID,并起一个别名(也可以不起)。", usage: '将你的SteamID与你的账号绑定,若本群已订阅将会实时获取你的新比赛数据发布至群中。名称中含有空格时需要使用""引号包裹(英文半角引号)。', examples: '绑定 123456789\n绑定 123456789 张三\n绑定 123456789 "张 三"', messages: { steam_id_invalid: "SteamID无效。", bind_success: "绑定成功,\nID:{userId}\n别名:{nickName}\nSteamID:{steamId}", bind_failed: "绑定失败,{0}", reason_without_match: "SteamID无效或无任何场次。", reason_fetch_failed: "网络状况不佳或其他原因无法验证SteamID,请稍后重试。", already_binded: "你已绑定,无需重复绑定。\n以下是你的个人信息:\nID:{userId}\n别名:{nickName}\nSteamID:{steamId}", nick_name_too_long: "别名过长,请限制在20个字符以内。(也可以留空)", is_anonymous: "请注意:你的Steam玩家数据并未公开,将无法使用BOT的主要功能,如“战报追踪”、“查询最近指令”等。\n如需公开数据,请在DOTA2游戏内设置中公开。" } }, unbind: { description: "[取消绑定] 取消绑定你的个人信息。", usage: "取消绑定你的个人信息。", examples: "取消绑定", messages: { unbind_success: "取消绑定成功。", not_binded: "尚未绑定,无需取消绑定。" } }, rename: { description: "[改名] 修改绑定时设定的别名。", usage: '修改绑定时设定的别名。名称中含有空格时需要使用""引号包裹(英文半角引号)。', examples: '改名 李四\n改名 "李 四"', messages: { rename_success: "改名成功,现在你叫{nick_name}了。", empty_input: "请输入你的别名。", not_binded: "请先绑定,绑定时即可设定别名。", nick_name_too_long: "别名过长,请限制在20个字符以内。", nick_name_same: "目标别名与原始别名相同,无需改名。" } }, "query-members": { description: "[查询群友] 查询本群已绑定的玩家。", usage: "查询本群已绑定的玩家,生成简单信息图片发布。", examples: "查询群友", messages: { title: "本群 DOTA2 玩家名册 (共 {count} 人)", table_headers: { nickname: "昵称/别名", winrate: "胜率 (近10场)", last_match: "最近比赛" }, no_members: "本群尚无绑定玩家。", query_failed: "查询群友失败。" } }, "query-match": { description: "[查询比赛] 查询指定比赛ID的比赛数据,生成图片发布。", usage: "查询指定MatchID的比赛数据,生成图片发布。", options: { parse: "-p 是否等待解析比赛数据" }, examples: "查询比赛 1234567890\n查询比赛 1234567890 -p\n查询比赛 1234567890 --parse", messages: { empty_input: "请输入比赛ID。", match_id_invalid: "比赛ID无效。", querying_match: "正在搜索对局详情,请稍后……", query_failed: "获取比赛数据失败。", waiting_for_parse: "比赛数据尚未解析,已发送解析请求到服务器,战报将在解析完成或超时后发送。" } }, "query-recent-match": { description: "[查询最近比赛] 查询最近的比赛数据,生成图片发布。", options: { parse: "-p 是否等待解析比赛数据" }, usage: "查询指定玩家的最近一场比赛的比赛数据,生成图片发布。\n参数可输入该玩家的SteamID或已在本群绑定玩家的别名,无参数时尝试查询调用指令玩家的SteamID。", examples: "查询最近比赛\n查询最近比赛 123456789\n查询最近比赛 张三\n查询最近比赛 123456789 -p\n查询最近比赛 张三 --parse", messages: { querying_match: "正在搜索对局详情,请稍后……", query_failed: "获取玩家最近比赛失败。", not_in_group: "指令调用失败。\n当前不属于群聊状态,必须提供指定玩家的SteamID。", is_anonymous: "你的比赛数据未公开,无法获取最近比赛数据。\n如需公开数据,请在DOTA2游戏内设置中公开。" } }, "query-player": { description: "[查询玩家] 查询玩家的个人信息,可指定英雄。", options: { hero: "-o 查询玩家指定英雄使用情况(同查询英雄,可用别名或ID)" }, usage: "查询指定玩家的个人信息,生成图片发布,可指定英雄。\n参数可输入该玩家的SteamID或已在本群绑定玩家的别名,无参数时尝试查询调用指令玩家的SteamID。", examples: "查询玩家\n查询玩家 123456789\n查询玩家 张三\n查询玩家 张三 --hero 敌法师\n查询玩家 张三 -o 15", messages: { querying_player: "正在获取玩家数据,请稍后……", query_failed: "获取玩家信息失败。", not_in_group: "指令调用失败。\n当前不属于群聊状态,必须提供指定玩家的SteamID。" } }, "query-hero": { description: "[查询英雄] 查询英雄技能/面板信息。", options: { random: "-r 随机选择英雄" }, usage: "查询英雄的技能说明与各项数据,生成图片发布。\n参数可输入英雄ID、英雄名、英雄常用别名。", examples: "查询英雄 15\n查询英雄 雷泽\n查询英雄 电魂\n查询英雄 -r", messages: { not_found: "未找到输入的英雄,请确认后重新输入。", querying_hero: "正在获取英雄数据,请稍后……", query_failed: "获取英雄数据失败。", empty_input: "请输入参数。" } }, "query-item": { description: "[查询物品] 查询物品信息。", usage: "查询物品的描述与各项数据,生成图片发布。\n参数可输入物品名(可模糊查找)、物品别名、物品ID。\n可在配置页中设置每次查询的最大发送数量、以及是否在超过限制或未输入参数时发送物品列表。", examples: "查询物品 先锋盾", messages: { query_list_failed: "获取物品列表数据失败。", query_item_failed: "获取物品「{0}」数据失败", querying_item: "正在查询物品数据,请稍候…", cache_building: "初次使用或缓存已过期,正在生成当前版本的物品缓存,请稍后……", empty_input: "未输入关键字参数。根据当前配置{#if show},将返回全部物品列表{:else}无内容可发送{/if}。", not_found: "未找到与关键字匹配的物品,请确认后重试。", too_many_items: "找到{count}个物品,超过最大发送限制({max}个){#if show},将发送物品列表{/if}。", finded_items: "找到以下物品:{#each items as item}{item.name_loc}{#if item !== items[items.length - 1]}、{/if}{/each}" } }, "hero-of-the-day": { description: "[今日英雄] 获取今日英雄推荐。", usage: "获取近期比赛记录、生涯比赛记录,根据胜场、表现分、是否手热等参数计算推荐英雄。\n参数可输入该玩家的SteamID或已在本群绑定玩家的别名,无参数时尝试查询调用指令玩家的SteamID。", options: { days: "-d <number> 近期数据的获取范围,单位为天数,默认值为30" }, examples: "今日英雄\n今日英雄 -d 60\n今日英雄 1234567890\n今日英雄 张三", messages: { title_recommendation: "今日推荐:", recommendation_intro: "今日为您推荐的英雄是:", recommendation_heroes: "{#each heroes as hero}{hero}{#if hero !== heroes[heroes.length - 1]}、{/if}{/each}", recommendation_type_lifetime_only: "您的近期数据为空,本次推荐结果基于您的生涯数据。", recommendation_type_no_record: "您的近期与生涯数据为空,无法生成推荐信息。", recommendation_type_anonymous: "您的个人数据未公开,无法生成推荐信息。", details: { pool_description: "推荐结果根据对您的近期与生涯英雄使用记录计分后,按总分排序后对前10位英雄以分数为权重随机取得。", table_intro: "以下是前10位英雄具体得分表。", table_headers: { hero: "英雄名称", recent_wins: "近期胜场分", lifetime_wins: "生涯胜场分<br>(对数)", imp_bonus: "imp奖励分", is_hot_streak: "是否手热", total_score: "总分" }, scoring_formula: "当前计分规则:[近期胜场数 x 1] + [log(生涯胜场数+1) x 5] + [近期imp x 0.1]", hot_streak_desc: "若英雄在3天内使用过,则记为手热英雄,总分提升20%。" }, title_meta: "环境趋势:", meta_intro: "一周内,基于您段位±1 ({tiers}) 范围内各位置<b>选择率≥2%</b>按胜率从高到低前三名优势英雄:", meta_table_header: "英雄名称(选择率% 胜率%)", meta_position: "{pos}号位:", querying: "正在查询玩家数据、英雄胜率等数据,请稍候……", query_failed: "指令调用失败。" } }, common: { messages: { user_not_binded_in_channel: "无参数时默认从已绑定SteamID玩家中寻找你的信息,但你似乎并没有绑定。\n请在本群绑定SteamID。(可输入【绑定 -h】获取帮助)\n或在指令后跟上希望查询的SteamID或已绑定玩家的别名。", user_not_in_group: "指令调用失败。\n当前不属于群聊状态,必须提供指定玩家的SteamID。", invalid_input_include_steam_id: "SteamID无效并且未在本群根据输入信息找到玩家。" } }, help: { description: "[DOTA2指南] 获取插件的全部指令详细信息与在线文档链接。", usage: "获取插件的全部指令详细信息与在线文档链接。", examples: "DOTA2指南\nDOTA2帮助\nDOTA2说明", messages: { header: "以下是插件的全部指令。\n※注意 <arg> 是必须参数,[arg] 是可选参数,具体使用方法请看“用法示例”列。", footer: "插件配置、模板展示等更多信息请访问在线文档:\nhttps://sjtdev.github.io/koishi-plugin-dota2tracker/", table_headers: { command: "指令名", alias: "指令中文", arguments: "参数", description: "说明", options: "选项", examples: "用法示例" } } } } } };
800
800
  }
801
801
  });
802
802
 
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: "别名" } }, 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: '模板所使用的字体名。需要 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) ' } } };
807
807
  }
808
808
  });
809
809
 
@@ -831,7 +831,7 @@ __export(src_exports, {
831
831
  usage: () => usage
832
832
  });
833
833
  module.exports = __toCommonJS(src_exports);
834
- var import_path5 = __toESM(require("path"));
834
+ var import_path4 = __toESM(require("path"));
835
835
 
836
836
  // src/app/common/i18n.ts
837
837
  var import_koishi = require("koishi");
@@ -1503,7 +1503,7 @@ function handleError(error, logger, i18n, config) {
1503
1503
  `;
1504
1504
  }
1505
1505
  output += error.stack;
1506
- const logLevel = config.suppressApiNetworkErrors || config.suppressStratzNetworkErrors ? "debug" : "error";
1506
+ const logLevel = config.suppressApiNetworkErrors ? "debug" : "error";
1507
1507
  logger[logLevel](output);
1508
1508
  } else {
1509
1509
  let output = "An unexpected error was thrown:\n";
@@ -1627,6 +1627,7 @@ var MatchService = class _MatchService extends import_koishi4.Service {
1627
1627
  const facetData = await _MatchService.constantsInjectFacetData(constantsQuery, matchQuery, languageTag, this.ctx.dota2tracker.hero);
1628
1628
  this.ctx.dota2tracker.cache.setFacetConstantsCache(languageTag, constantsQuery);
1629
1629
  const match = _MatchService.extendMatchData(matchQuery, facetData, this.ctx.dota2tracker.dotaconstants);
1630
+ this.ctx.dota2tracker.report.recordMatchExtension(match);
1630
1631
  return match;
1631
1632
  } catch (error) {
1632
1633
  this.ctx.dota2tracker.cache.deleteFacetConstantsCache(languageTag);
@@ -2232,7 +2233,6 @@ var CacheService = class extends import_koishi6.Service {
2232
2233
  }
2233
2234
  addOpendotaAPIRequestLog(request, count = 1) {
2234
2235
  this.ctx.cache.set("dt_opendota_api_request_log", String(Date.now()), { count, request }, this.msUntilUTCEndOfDay);
2235
- if (this.config.enableConsole) this.ctx.console.services["apiCount"].refresh();
2236
2236
  }
2237
2237
  async getTodayOpendotaAPIRequestCount() {
2238
2238
  let count = 0;
@@ -2312,6 +2312,10 @@ var DatabaseService = class extends import_koishi7.Service {
2312
2312
  },
2313
2313
  { autoInc: true }
2314
2314
  );
2315
+ ctx.model.extend("dt_match_extension", { matchId: "unsigned", startTime: "timestamp", data: "json" }, { autoInc: false, primary: ["matchId"] });
2316
+ }
2317
+ async insertReportData(matchId, startTime, data) {
2318
+ return this.ctx.database.upsert("dt_match_extension", [{ matchId, startTime, data }]);
2315
2319
  }
2316
2320
  async setPlayerRank(playerId, rank) {
2317
2321
  return this.ctx.database.set("dt_subscribed_players", playerId, { rank });
@@ -2548,11 +2552,11 @@ var MiniQueue = class {
2548
2552
  if (this.stopped) {
2549
2553
  return Promise.reject(new Error("Queue has been disposed."));
2550
2554
  }
2551
- return new Promise((resolve2, reject) => {
2555
+ return new Promise((resolve, reject) => {
2552
2556
  this.queue.push(async () => {
2553
2557
  try {
2554
2558
  const result = await task();
2555
- resolve2(result);
2559
+ resolve(result);
2556
2560
  } catch (error) {
2557
2561
  reject(error);
2558
2562
  }
@@ -2573,7 +2577,7 @@ var MiniQueue = class {
2573
2577
  const task = this.queue.shift();
2574
2578
  if (task) {
2575
2579
  await task();
2576
- await new Promise((resolve2) => this.ctx.setTimeout(resolve2, this.interval));
2580
+ await new Promise((resolve) => this.ctx.setTimeout(resolve, this.interval));
2577
2581
  }
2578
2582
  this.isProcessing = false;
2579
2583
  this._process();
@@ -2640,7 +2644,7 @@ var ValveAPI = class extends import_koishi9.Service {
2640
2644
  }
2641
2645
  };
2642
2646
 
2643
- // src/app/presentation/image.renderer.ts
2647
+ // src/app/presentation/view.renderer.ts
2644
2648
  var import_koishi10 = require("koishi");
2645
2649
  var import_ejs = __toESM(require("ejs"));
2646
2650
  var import_fs2 = __toESM(require("fs"));
@@ -2664,11 +2668,11 @@ var ImageFormat = /* @__PURE__ */ ((ImageFormat2) => {
2664
2668
  return ImageFormat2;
2665
2669
  })(ImageFormat || {});
2666
2670
 
2667
- // src/app/presentation/image.renderer.ts
2671
+ // src/app/presentation/view.renderer.ts
2668
2672
  var import_luxon5 = require("luxon");
2669
- var ImageRenderer = class extends import_koishi10.Service {
2673
+ var ViewRenderer = class extends import_koishi10.Service {
2670
2674
  static {
2671
- __name(this, "ImageRenderer");
2675
+ __name(this, "ViewRenderer");
2672
2676
  }
2673
2677
  templateDir;
2674
2678
  constructor(ctx, currentDir) {
@@ -2803,7 +2807,7 @@ var MessageBuilder = class extends import_koishi11.Service {
2803
2807
  table.push(row);
2804
2808
  }
2805
2809
  html += this._createTableHTML(table, void 0, this.ctx.i18n._data[languageTag]["commands.dota2tracker.help.messages.header"]);
2806
- message += await this.ctx.dota2tracker.image.renderToImageByEJSCode(void 0, html, languageTag);
2810
+ message += await this.ctx.dota2tracker.view.renderToImageByEJSCode(void 0, html, languageTag);
2807
2811
  message += this.ctx.dota2tracker.i18n.$t(languageTag, "commands.dota2tracker.help.messages.footer");
2808
2812
  return message;
2809
2813
  }
@@ -2855,7 +2859,7 @@ var MessageBuilder = class extends import_koishi11.Service {
2855
2859
  ejs2 += `<p>${$t("meta_position", { pos: pos.at(-1) })}${heroesText}</p>`;
2856
2860
  }
2857
2861
  ejs2 += "</body></html>";
2858
- return await this.ctx.dota2tracker.image.renderToImageByEJSCode(void 0, ejs2, languageTag);
2862
+ return await this.ctx.dota2tracker.view.renderToImageByEJSCode(void 0, ejs2, languageTag);
2859
2863
  }
2860
2864
  buildMatchMessage(languageTag, match, players) {
2861
2865
  let broadMatchMessage = "";
@@ -2971,7 +2975,7 @@ var MessageBuilder = class extends import_koishi11.Service {
2971
2975
  </body>
2972
2976
  </html>
2973
2977
  `;
2974
- return await this.ctx.dota2tracker.image.renderToImageByEJSCode({}, ejs2, languageTag);
2978
+ return await this.ctx.dota2tracker.view.renderToImageByEJSCode({}, ejs2, languageTag);
2975
2979
  }
2976
2980
  buildRankChangedMessage(languageTag, name2, prevRank, currRank) {
2977
2981
  return this.ctx.dota2tracker.i18n.$t(languageTag, "dota2tracker.broadcast.rank_changed", {
@@ -3120,7 +3124,7 @@ var MatchWatcherTask = class extends import_koishi12.Service {
3120
3124
  const name2 = subPlayer.nickName ?? guildMember?.nick ?? playersData.find((player) => player.steamAccount.id == subPlayer.steamId)?.steamAccount.name ?? String(subPlayer.steamId);
3121
3125
  const languageTag = await this.ctx.dota2tracker.i18n.getLanguageTag({ channelId: subPlayer.guildId });
3122
3126
  if (this.config.rankBroadFun === true) {
3123
- const img = await this.ctx.dota2tracker.image.renderToImageByFile(
3127
+ const img = await this.ctx.dota2tracker.view.renderToImageByFile(
3124
3128
  {
3125
3129
  name: name2,
3126
3130
  avatar: guildMember?.avatar ?? playersData.find((player) => subPlayer.steamId == player.steamAccount.id).steamAccount.avatar,
@@ -3226,7 +3230,7 @@ var ParsePollingTask = class extends import_koishi13.Service {
3226
3230
  const defaultTemplateSubscribers = subscribers.filter((s) => s.source === "AUTOMATIC" || s.source === "COMMAND" && !s.templateName);
3227
3231
  const customTemplateSubscribers = subscribers.filter((s) => s.source === "COMMAND" && s.templateName);
3228
3232
  if (defaultTemplateSubscribers.length > 0) {
3229
- const defaultImage = await this.ctx.dota2tracker.image.renderToImageByFile(formattedMatchData, this.config.template_match, "match" /* Match */, languageTag);
3233
+ const defaultImage = await this.ctx.dota2tracker.view.renderToImageByFile(formattedMatchData, this.config.template_match, "match" /* Match */, languageTag);
3230
3234
  for (const sub of defaultTemplateSubscribers) {
3231
3235
  const message = this.ctx.dota2tracker.messageBuilder.buildMatchMessage(languageTag, formattedMatchData, sub.relevantPlayers);
3232
3236
  await this.broadcastMessage(sub, message + defaultImage);
@@ -3234,7 +3238,7 @@ var ParsePollingTask = class extends import_koishi13.Service {
3234
3238
  }
3235
3239
  }
3236
3240
  for (const sub of customTemplateSubscribers) {
3237
- const image = await this.ctx.dota2tracker.image.renderToImageByFile(formattedMatchData, sub.source === "COMMAND" ? sub.templateName : this.config.template_match, "match" /* Match */, languageTag);
3241
+ const image = await this.ctx.dota2tracker.view.renderToImageByFile(formattedMatchData, sub.source === "COMMAND" ? sub.templateName : this.config.template_match, "match" /* Match */, languageTag);
3238
3242
  const message = this.ctx.dota2tracker.messageBuilder.buildMatchMessage(languageTag, formattedMatchData, sub.relevantPlayers);
3239
3243
  await this.broadcastMessage(sub, message + image);
3240
3244
  guildsToLogger.push({ platform: sub.platform, guildId: sub.channelId, languageTag });
@@ -3375,7 +3379,7 @@ var ReportTask = class extends import_koishi14.Service {
3375
3379
  const languageTag = await this.ctx.dota2tracker.i18n.getLanguageTag({ channelId: guild.guildId });
3376
3380
  await this.ctx.broadcast(
3377
3381
  [`${guild.platform}:${guild.guildId}`],
3378
- await this.ctx.dota2tracker.image.renderToImageByFile(
3382
+ await this.ctx.dota2tracker.view.renderToImageByFile(
3379
3383
  {
3380
3384
  title: this.ctx.dota2tracker.i18n.$t(languageTag, titleKey),
3381
3385
  players: currentsubscribedPlayers.sort((a, b) => {
@@ -3454,13 +3458,58 @@ async function resolvePlayerAndHandleErrors(ctx, session, input) {
3454
3458
  return Number(result.steamId);
3455
3459
  }
3456
3460
  __name(resolvePlayerAndHandleErrors, "resolvePlayerAndHandleErrors");
3461
+ var TaskMessenger = class {
3462
+ constructor(session, options = { autoRecall: true }) {
3463
+ this.session = session;
3464
+ this.options = options;
3465
+ }
3466
+ static {
3467
+ __name(this, "TaskMessenger");
3468
+ }
3469
+ tipIds = [];
3470
+ /**
3471
+ * 发送一条提示消息,并记录其 ID 以便后续撤回
3472
+ * @param content 提示内容
3473
+ * @returns 返回 this 实例,支持链式调用
3474
+ */
3475
+ async send(content) {
3476
+ try {
3477
+ const result = await this.session.send(content);
3478
+ const newIds = Array.isArray(result) ? result : [result];
3479
+ this.tipIds.push(...newIds);
3480
+ } catch (e) {
3481
+ }
3482
+ return this;
3483
+ }
3484
+ /**
3485
+ * 任务结束,撤回所有提示消息
3486
+ */
3487
+ async finish() {
3488
+ if (!this.options.autoRecall) {
3489
+ this.tipIds = [];
3490
+ return;
3491
+ }
3492
+ if (this.tipIds.length === 0) return;
3493
+ const idsToRecall = [...this.tipIds].reverse();
3494
+ this.tipIds = [];
3495
+ for (const id of idsToRecall) {
3496
+ try {
3497
+ await this.session.bot.deleteMessage(this.session.channelId, id);
3498
+ } catch (e) {
3499
+ }
3500
+ }
3501
+ }
3502
+ };
3457
3503
 
3458
3504
  // src/app/commands/hero-of-the-day.command.ts
3459
3505
  var import_luxon10 = require("luxon");
3460
3506
  function registerHeroOfTheDayCommand(ctx) {
3461
3507
  const name2 = "hero-of-the-day";
3508
+ const logger = ctx.logger("command/" + name2);
3462
3509
  ctx.command(`dota2tracker.${name2} <input_data>`).alias("今日英雄").option("days", "-d <value:number>").action(async ({ session, options }, input_data) => {
3510
+ const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
3463
3511
  try {
3512
+ await task.send(session.text(".querying"));
3464
3513
  const steamId = await resolvePlayerAndHandleErrors(ctx, session, input_data);
3465
3514
  if (steamId === null) return;
3466
3515
  const days = clamp(options.days, 1, 180, 30);
@@ -3472,10 +3521,13 @@ function registerHeroOfTheDayCommand(ctx) {
3472
3521
  const metaPromise = ctx.dota2tracker.hero.getWeeklyHeroMeta(PlayerService.estimateWeightedRank(result.player));
3473
3522
  const [recommendation, weeklyHeroMeta] = await Promise.all([recommendationPromise, metaPromise]);
3474
3523
  const languageTag = await ctx.dota2tracker.i18n.getLanguageTag({ session });
3524
+ await task.finish();
3475
3525
  const message = ctx.dota2tracker.messageBuilder.buildHeroOfTheDayMessage(languageTag, recommendation, weeklyHeroMeta);
3476
3526
  return message;
3477
3527
  } catch (error) {
3478
- handleError(error, ctx.logger(name2), ctx.dota2tracker.i18n, ctx.config);
3528
+ await task.finish();
3529
+ handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
3530
+ return session.text(".query_failed");
3479
3531
  }
3480
3532
  });
3481
3533
  }
@@ -3483,20 +3535,28 @@ __name(registerHeroOfTheDayCommand, "registerHeroOfTheDayCommand");
3483
3535
 
3484
3536
  // src/app/commands/query-hero.command.ts
3485
3537
  function registerQueryHeroCommand(ctx) {
3486
- ctx.command("dota2tracker.query-hero <input_data>").option("random", "-r").alias("查询英雄").action(async ({ session, options }, input_data) => {
3487
- const name2 = "query-hero";
3538
+ const name2 = "query-hero";
3539
+ const logger = ctx.logger("command/" + name2);
3540
+ ctx.command(`dota2tracker.${name2} <input_data>`).option("random", "-r").alias("查询英雄").action(async ({ session, options }, input_data) => {
3541
+ const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
3488
3542
  try {
3489
3543
  if (input_data || options.random) {
3490
- await session.send(session.text(".querying_hero"));
3544
+ await task.send(session.text(".querying_hero"));
3491
3545
  const languageTag = await ctx.dota2tracker.i18n.getLanguageTag({ session });
3492
3546
  const heroData = await ctx.dota2tracker.hero.getHeroDetails(input_data, languageTag, options.random);
3493
- if (!heroData) return session.text(".not_found");
3494
- const image = await ctx.dota2tracker.image.renderToImageByFile(heroData, ctx.config.template_hero, "hero" /* Hero */, languageTag);
3547
+ if (!heroData) {
3548
+ await task.finish();
3549
+ return session.text(".not_found");
3550
+ }
3551
+ const image = await ctx.dota2tracker.view.renderToImageByFile(heroData, ctx.config.template_hero, "hero" /* Hero */, languageTag);
3495
3552
  const message = ctx.dota2tracker.messageBuilder.buildHeroMessage(heroData);
3553
+ await task.finish();
3496
3554
  await session.send(message + image);
3497
3555
  }
3498
3556
  } catch (error) {
3499
- handleError(error, ctx.logger(name2), ctx.dota2tracker.i18n, ctx.config);
3557
+ await task.finish();
3558
+ handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
3559
+ return session.text(".query_failed");
3500
3560
  }
3501
3561
  });
3502
3562
  }
@@ -3504,46 +3564,56 @@ __name(registerQueryHeroCommand, "registerQueryHeroCommand");
3504
3564
 
3505
3565
  // src/app/commands/query-item.command.ts
3506
3566
  function registerQueryItemCommand(ctx) {
3507
- ctx.command("dota2tracker.query-item <input_data>").alias("查询物品").action(async ({ session }, input_data) => {
3508
- if (!input_data) {
3509
- if (ctx.config.showItemListAtTooMuchItems) {
3510
- await session.send(session.text(".querying_item"));
3511
- const languageTag2 = await ctx.dota2tracker.i18n.getLanguageTag({ session });
3512
- const allItems = await ctx.dota2tracker.item.getItemList({ languageTag: languageTag2, onCacheMissTip: /* @__PURE__ */ __name(() => session.send(session.text(".cache_building")), "onCacheMissTip") });
3513
- const image = await ctx.dota2tracker.image.renderToImageByFile(allItems, "itemlist", "item" /* Item */, languageTag2);
3514
- await session.send(image);
3515
- } else {
3516
- await session.send(session.text(".empty_input"));
3517
- }
3518
- return;
3519
- }
3520
- await session.send(session.text(".querying_item"));
3521
- const languageTag = await ctx.dota2tracker.i18n.getLanguageTag({ session });
3522
- const itemList = await ctx.dota2tracker.item.getItemList({ languageTag, onCacheMissTip: /* @__PURE__ */ __name(() => session.send(session.text(".cache_building")), "onCacheMissTip") });
3523
- const matchedItemList = ctx.dota2tracker.item.searchItems(itemList, input_data, languageTag, ctx.config);
3524
- if (matchedItemList.length === 0) {
3525
- await session.send(session.text(".not_found"));
3567
+ const name2 = "query-item";
3568
+ const logger = ctx.logger("command/" + name2);
3569
+ ctx.command(`dota2tracker.${name2} <input_data>`).alias("查询物品").action(async ({ session }, input_data) => {
3570
+ const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
3571
+ if (!input_data && !ctx.config.showItemListAtTooMuchItems) {
3572
+ await session.send(session.text(".empty_input"));
3526
3573
  return;
3527
3574
  }
3528
- if (matchedItemList.length > ctx.config.maxSendItemCount) {
3529
- await session.send(session.text(".too_many_items", { count: matchedItemList.length, max: ctx.config.maxSendItemCount }));
3530
- if (ctx.config.showItemListAtTooMuchItems) {
3531
- const image = await ctx.dota2tracker.image.renderToImageByFile(matchedItemList, "itemlist", "item" /* Item */, languageTag);
3575
+ try {
3576
+ await task.send(session.text(".querying_item"));
3577
+ const languageTag = await ctx.dota2tracker.i18n.getLanguageTag({ session });
3578
+ const itemList = await ctx.dota2tracker.item.getItemList({ languageTag, onCacheMissTip: /* @__PURE__ */ __name(() => task.send(session.text(".cache_building")), "onCacheMissTip") });
3579
+ if (!input_data) {
3580
+ const image = await ctx.dota2tracker.view.renderToImageByFile(itemList, "itemlist", "item" /* Item */, languageTag);
3581
+ await task.finish();
3532
3582
  await session.send(image);
3583
+ return;
3533
3584
  }
3534
- return;
3535
- }
3536
- await session.send(session.text(".finded_items", { items: matchedItemList }));
3537
- for (const basicItemInfo of matchedItemList) {
3538
- try {
3539
- const itemDetails = await ctx.dota2tracker.item.getItemDetails(basicItemInfo.id, languageTag);
3540
- const finalItemData = { ...itemDetails, ...basicItemInfo };
3541
- const image = await ctx.dota2tracker.image.renderToImageByFile(finalItemData, "item", "item" /* Item */, languageTag);
3542
- await session.send(image);
3543
- } catch (error) {
3544
- ctx.logger.error(`查询物品[${basicItemInfo.name_loc}]详情失败:`, error);
3545
- await session.send(session.text(".query_item_failed", { name: basicItemInfo.name_loc }));
3585
+ const matchedItemList = ctx.dota2tracker.item.searchItems(itemList, input_data, languageTag, ctx.config);
3586
+ if (matchedItemList.length === 0) {
3587
+ await task.finish();
3588
+ await session.send(session.text(".not_found"));
3589
+ return;
3546
3590
  }
3591
+ if (matchedItemList.length > ctx.config.maxSendItemCount) {
3592
+ await task.finish();
3593
+ await session.send(session.text(".too_many_items", { count: matchedItemList.length, max: ctx.config.maxSendItemCount }));
3594
+ if (ctx.config.showItemListAtTooMuchItems) {
3595
+ const image = await ctx.dota2tracker.view.renderToImageByFile(matchedItemList, "itemlist", "item" /* Item */, languageTag);
3596
+ await session.send(image);
3597
+ }
3598
+ return;
3599
+ }
3600
+ await task.finish();
3601
+ await session.send(session.text(".finded_items", { items: matchedItemList }));
3602
+ for (const basicItemInfo of matchedItemList) {
3603
+ try {
3604
+ const itemDetails = await ctx.dota2tracker.item.getItemDetails(basicItemInfo.id, languageTag);
3605
+ const finalItemData = { ...itemDetails, ...basicItemInfo };
3606
+ const image = await ctx.dota2tracker.view.renderToImageByFile(finalItemData, "item", "item" /* Item */, languageTag);
3607
+ await session.send(image);
3608
+ } catch (error) {
3609
+ ctx.logger.error(`查询物品[${basicItemInfo.name_loc}]详情失败:`, error);
3610
+ await session.send(session.text(".query_item_failed", { name: basicItemInfo.name_loc }));
3611
+ }
3612
+ }
3613
+ } catch (error) {
3614
+ await task.finish();
3615
+ handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
3616
+ return session.text(".query_list_failed");
3547
3617
  }
3548
3618
  });
3549
3619
  }
@@ -3553,32 +3623,45 @@ __name(registerQueryItemCommand, "registerQueryItemCommand");
3553
3623
  function registerQueryMatchCommand(ctx) {
3554
3624
  ctx.command("dota2tracker.query-match <match_id>").alias("查询比赛").option("parse", "-p").option("template", "-t <value:string>").action(async ({ session, options }, match_id) => {
3555
3625
  const name2 = "query-match";
3626
+ const logger = ctx.logger("command/" + name2);
3627
+ const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
3556
3628
  try {
3557
3629
  if (!match_id) return session.text(".empty_input");
3558
3630
  if (!/^\d{1,11}$/.test(match_id)) return session.text(".match_id_invalid");
3559
- await session.send(session.text(".querying_match"));
3560
- return await handleQueryMatchCommand(ctx, ctx.config, session, options, match_id);
3631
+ await task.send(session.text(".querying_match"));
3632
+ const message = await handleQueryMatchCommand(ctx, ctx.config, session, options, match_id);
3633
+ await task.finish();
3634
+ return message;
3561
3635
  } catch (error) {
3562
- handleError(error, ctx.logger(name2), ctx.dota2tracker.i18n, ctx.config);
3636
+ await task.finish();
3637
+ handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
3638
+ return session.text(".query_failed");
3563
3639
  }
3564
3640
  });
3565
3641
  ctx.command("dota2tracker.query-recent-match [input_data]").alias("查询最近比赛").option("parse", "-p").option("template", "-t <value:string>").action(async ({ session, options }, input_data) => {
3566
3642
  const name2 = "query-recent-match";
3643
+ const logger = ctx.logger("command/" + name2);
3644
+ const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
3567
3645
  try {
3568
3646
  const steamId = await resolvePlayerAndHandleErrors(ctx, session, input_data);
3569
3647
  if (steamId === null) return;
3570
- session.send(session.text(".querying_match"));
3571
- let lastMatch;
3572
- try {
3573
- lastMatch = await ctx.dota2tracker.player.getLastMatchId(Number(steamId));
3574
- } catch (error) {
3575
- handleError(error, ctx.logger(name2), ctx.dota2tracker.i18n, ctx.config);
3648
+ await task.send(session.text(".querying_match"));
3649
+ const lastMatch = await ctx.dota2tracker.player.getLastMatchId(Number(steamId));
3650
+ if (!lastMatch?.id) {
3651
+ await task.finish();
3652
+ return session.text(".query_failed");
3653
+ }
3654
+ if (lastMatch.isAnonymous) {
3655
+ await task.finish();
3656
+ return session.text(".is_anonymous");
3576
3657
  }
3577
- if (!lastMatch?.id) return session.text(".query_failed");
3578
- if (lastMatch.isAnonymous) return session.text(".is_anonymous");
3579
- return await handleQueryMatchCommand(ctx, ctx.config, session, options, lastMatch.id);
3658
+ const message = await handleQueryMatchCommand(ctx, ctx.config, session, options, lastMatch.id);
3659
+ await task.finish();
3660
+ return message;
3580
3661
  } catch (error) {
3581
- handleError(error, ctx.logger(name2), ctx.dota2tracker.i18n, ctx.config);
3662
+ await task.finish();
3663
+ handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
3664
+ return session.text(".query_failed");
3582
3665
  }
3583
3666
  });
3584
3667
  }
@@ -3595,7 +3678,7 @@ async function handleQueryMatchCommand(ctx, config, session, options, matchId) {
3595
3678
  } else {
3596
3679
  const formattedMatchData = await ctx.dota2tracker.match.generateMatchData(result.matchData, languageTag);
3597
3680
  const message = ctx.dota2tracker.messageBuilder.buildMatchMessage(languageTag, formattedMatchData, []);
3598
- const image = await ctx.dota2tracker.image.renderToImageByFile(formattedMatchData, options.template || config.template_match, "match" /* Match */, languageTag);
3681
+ const image = await ctx.dota2tracker.view.renderToImageByFile(formattedMatchData, options.template || config.template_match, "match" /* Match */, languageTag);
3599
3682
  return message + image;
3600
3683
  }
3601
3684
  }
@@ -3615,24 +3698,29 @@ __name(registerQueryMembersCommand, "registerQueryMembersCommand");
3615
3698
 
3616
3699
  // src/app/commands/query-player.command.ts
3617
3700
  function registerQueryPlayerCommand(ctx) {
3701
+ const name2 = "query-player";
3702
+ const logger = ctx.logger("command/" + name2);
3618
3703
  ctx.command("dota2tracker.query-player <input_data>").option("hero", "-o <value:string>").alias("查询玩家").action(async ({ session, options }, input_data) => {
3619
- const name2 = "query-player";
3704
+ const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
3620
3705
  try {
3621
3706
  if (session.guild || !session.guild && input_data) {
3622
3707
  const steamId = await resolvePlayerAndHandleErrors(ctx, session, input_data);
3623
3708
  if (steamId === null) return;
3624
- session.send(session.text(".querying_player"));
3709
+ await task.send(session.text(".querying_player"));
3625
3710
  const heroId = ctx.dota2tracker.i18n.findHeroIdInLocale(options.hero);
3626
3711
  const languageTag = await ctx.dota2tracker.i18n.getLanguageTag({ session });
3627
3712
  const formattedPlayerData = await ctx.dota2tracker.player.getFormattedPlayerData(steamId, heroId, languageTag);
3628
- const image = await ctx.dota2tracker.image.renderToImageByFile(formattedPlayerData, ctx.config.template_player, "player" /* Player */, languageTag);
3713
+ const image = await ctx.dota2tracker.view.renderToImageByFile(formattedPlayerData, ctx.config.template_player, "player" /* Player */, languageTag);
3629
3714
  const message = ctx.dota2tracker.messageBuilder.buildPlayerMessage(steamId);
3715
+ await task.finish();
3630
3716
  return message + image;
3631
3717
  } else {
3632
3718
  return session.text("commands.dota2tracker.common.messages.user_not_in_group");
3633
3719
  }
3634
3720
  } catch (error) {
3635
- handleError(error, ctx.logger(name2), ctx.dota2tracker.i18n, ctx.config);
3721
+ await task.finish();
3722
+ handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
3723
+ return session.text(".query_failed");
3636
3724
  }
3637
3725
  });
3638
3726
  }
@@ -3907,6 +3995,13 @@ var OpenDotaAdapter = class extends import_koishi16.Service {
3907
3995
  radiantExperienceLeads: [0, ..._match.radiant_xp_adv],
3908
3996
  // opendota两组数据都需要补充-1分钟时的数据对齐stratz格式。
3909
3997
  winRates: null,
3998
+ towerStatusRadiant: _match.tower_status_radiant,
3999
+ towerStatusDire: _match.tower_status_dire,
4000
+ barracksStatusRadiant: _match.barracks_status_radiant,
4001
+ barracksStatusDire: _match.barracks_status_dire,
4002
+ playbackData: {
4003
+ buildingEvents: convertBuildingEvents(_match.objectives)
4004
+ },
3910
4005
  players,
3911
4006
  pickBans: _match.picks_bans?.map((pb) => ({ isPick: pb.is_pick, ...pb.is_pick ? { heroId: pb.hero_id, bannedHeroId: null } : { bannedHeroId: pb.hero_id, heroId: null }, order: pb.order })),
3912
4007
  odParsed: true
@@ -4160,46 +4255,92 @@ function determineIMP(player) {
4160
4255
  return Math.round(totalScore / values.length * 100 - 50);
4161
4256
  }
4162
4257
  __name(determineIMP, "determineIMP");
4163
-
4164
- // src/console.ts
4165
- var import_path3 = require("path");
4166
-
4167
- // src/app/console/data.ts
4168
- var import_plugin_console = require("@koishijs/plugin-console");
4169
- var CustomProvider = class extends import_plugin_console.DataService {
4170
- // 临时存储dota2tracker对象
4171
- constructor(ctx, tracker) {
4172
- super(ctx, "apiCount");
4173
- this.tracker = tracker;
4174
- this.tracker = tracker;
4258
+ function convertBuildingEvents(objectives) {
4259
+ if (!objectives) return [];
4260
+ const KEY_TO_ID = {
4261
+ // ================= 天辉 Radiant =================
4262
+ npc_dota_goodguys_tower1_top: 16,
4263
+ npc_dota_goodguys_tower2_top: 19,
4264
+ npc_dota_goodguys_tower3_top: 22,
4265
+ npc_dota_goodguys_tower1_mid: 17,
4266
+ npc_dota_goodguys_tower2_mid: 20,
4267
+ npc_dota_goodguys_tower3_mid: 23,
4268
+ npc_dota_goodguys_tower1_bot: 18,
4269
+ npc_dota_goodguys_tower2_bot: 21,
4270
+ npc_dota_goodguys_tower3_bot: 24,
4271
+ npc_dota_goodguys_tower4: 25,
4272
+ // 统一映射 T4
4273
+ npc_dota_goodguys_melee_rax_top: 38,
4274
+ npc_dota_goodguys_range_rax_top: 41,
4275
+ npc_dota_goodguys_melee_rax_mid: 39,
4276
+ npc_dota_goodguys_range_rax_mid: 42,
4277
+ npc_dota_goodguys_melee_rax_bot: 40,
4278
+ npc_dota_goodguys_range_rax_bot: 43,
4279
+ npc_dota_goodguys_fort: 50,
4280
+ // ================= 夜魇 Dire =================
4281
+ npc_dota_badguys_tower1_top: 26,
4282
+ npc_dota_badguys_tower2_top: 29,
4283
+ npc_dota_badguys_tower3_top: 32,
4284
+ npc_dota_badguys_tower1_mid: 27,
4285
+ npc_dota_badguys_tower2_mid: 30,
4286
+ npc_dota_badguys_tower3_mid: 33,
4287
+ npc_dota_badguys_tower1_bot: 28,
4288
+ npc_dota_badguys_tower2_bot: 31,
4289
+ npc_dota_badguys_tower3_bot: 34,
4290
+ npc_dota_badguys_tower4: 35,
4291
+ // 统一映射 T4
4292
+ npc_dota_badguys_melee_rax_top: 44,
4293
+ npc_dota_badguys_range_rax_top: 47,
4294
+ npc_dota_badguys_melee_rax_mid: 45,
4295
+ npc_dota_badguys_range_rax_mid: 48,
4296
+ npc_dota_badguys_melee_rax_bot: 46,
4297
+ npc_dota_badguys_range_rax_bot: 49,
4298
+ npc_dota_badguys_fort: 51
4299
+ };
4300
+ const events = [];
4301
+ for (const obj of objectives) {
4302
+ if (obj.type === "building_kill" && obj.key && KEY_TO_ID[obj.key]) {
4303
+ events.push({
4304
+ time: obj.time,
4305
+ npcId: KEY_TO_ID[obj.key]
4306
+ });
4307
+ }
4175
4308
  }
4309
+ return events;
4310
+ }
4311
+ __name(convertBuildingEvents, "convertBuildingEvents");
4312
+
4313
+ // src/app/core/report.service.ts
4314
+ var import_koishi17 = require("koishi");
4315
+ var ReportService = class extends import_koishi17.Service {
4176
4316
  static {
4177
- __name(this, "CustomProvider");
4317
+ __name(this, "ReportService");
4178
4318
  }
4179
- async get() {
4180
- return { opendota: await this.tracker.cache.getTodayOpendotaAPIRequestCount() };
4319
+ constructor(ctx) {
4320
+ super(ctx, "dota2tracker.report", true);
4321
+ this.config = ctx.config;
4322
+ }
4323
+ async recordMatchExtension(match) {
4324
+ const extensionData = { matchId: match.id, players: [] };
4325
+ for (const player of match.players) {
4326
+ extensionData.players.push({
4327
+ steamAccountId: player.steamAccountId,
4328
+ rankSnapshot: player.rank,
4329
+ mvpScore: player.mvpScore,
4330
+ titles: player.titles,
4331
+ utilityScore: player.utilityScore,
4332
+ laneResult: player.laneResult,
4333
+ partyId: player.partyId
4334
+ });
4335
+ }
4336
+ this.ctx.dota2tracker.database.insertReportData(extensionData.matchId, new Date(match.startDateTime * 1e3), extensionData);
4181
4337
  }
4182
4338
  };
4183
4339
 
4184
- // src/console.ts
4185
- function registerConsolePage(ctx) {
4186
- const tracker = ctx.dota2tracker;
4187
- if (!tracker) {
4188
- ctx.logger("dota2tracker").warn("dota2tracker service is missing during console registration!");
4189
- return;
4190
- }
4191
- new CustomProvider(ctx, tracker);
4192
- ctx.console.addEntry({
4193
- dev: (0, import_path3.resolve)(__dirname, "../client/index.ts"),
4194
- prod: (0, import_path3.resolve)(__dirname, "../dist")
4195
- });
4196
- }
4197
- __name(registerConsolePage, "registerConsolePage");
4198
-
4199
4340
  // src/config.ts
4200
- var import_koishi17 = require("koishi");
4341
+ var import_koishi18 = require("koishi");
4201
4342
  var import_fs3 = __toESM(require("fs"));
4202
- var import_path4 = __toESM(require("path"));
4343
+ var import_path3 = __toESM(require("path"));
4203
4344
 
4204
4345
  // require("./locales/**/*.schema.yml") in src/config.ts
4205
4346
  var globRequire_locales_schema_yml = __glob({
@@ -4208,82 +4349,81 @@ var globRequire_locales_schema_yml = __glob({
4208
4349
  });
4209
4350
 
4210
4351
  // src/config.ts
4211
- var templateDir = import_path4.default.join(__dirname, "templates");
4352
+ var templateDir = import_path3.default.join(__dirname, "templates");
4212
4353
  var allI18nConfigs = Object.fromEntries(Object.keys(LanguageTags).map((lang) => [lang, globRequire_locales_schema_yml(`./locales/${lang}.schema.yml`)._config]));
4213
- var Config = import_koishi17.Schema.intersect([
4214
- import_koishi17.Schema.intersect([
4215
- import_koishi17.Schema.object({
4216
- STRATZ_API_TOKEN: import_koishi17.Schema.string().required().role("secret"),
4217
- dataParsingTimeoutMinutes: import_koishi17.Schema.number().default(60).min(0).max(1440),
4218
- proxyAddress: import_koishi17.Schema.string(),
4219
- suppressStratzNetworkErrors: import_koishi17.Schema.boolean().default(false).deprecated(),
4220
- suppressApiNetworkErrors: import_koishi17.Schema.boolean().default(false),
4221
- enableOpenDotaFallback: import_koishi17.Schema.boolean().default(false),
4222
- enableConsole: import_koishi17.Schema.boolean().default(false).experimental()
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)
4223
4362
  }).i18n(getI18n("base")),
4224
- import_koishi17.Schema.union([
4225
- import_koishi17.Schema.object({
4226
- enableOpenDotaFallback: import_koishi17.Schema.const(true).required(),
4227
- OPENDOTA_API_KEY: import_koishi17.Schema.string().role("secret"),
4228
- OpenDotaIPStack: import_koishi17.Schema.union(["auto", "ipv4"]).default("auto")
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")
4229
4368
  }),
4230
- import_koishi17.Schema.object({})
4369
+ import_koishi18.Schema.object({})
4231
4370
  ]).i18n(getI18n("base"))
4232
4371
  ]),
4233
- import_koishi17.Schema.intersect([
4234
- import_koishi17.Schema.object({
4235
- useHeroNicknames: import_koishi17.Schema.boolean().default(true),
4236
- urlInMessageType: import_koishi17.Schema.array(import_koishi17.Schema.union([import_koishi17.Schema.const("match"), import_koishi17.Schema.const("player"), import_koishi17.Schema.const("hero")])).role("checkbox"),
4237
- maxSendItemCount: import_koishi17.Schema.number().default(5).min(1).max(10),
4238
- showItemListAtTooMuchItems: import_koishi17.Schema.boolean().default(true),
4239
- customItemAlias: import_koishi17.Schema.array(
4240
- import_koishi17.Schema.object({
4241
- keyword: import_koishi17.Schema.string().required(),
4242
- alias: import_koishi17.Schema.string().required()
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()
4243
4382
  })
4244
4383
  ).default([]).role("table"),
4245
- rankBroadSwitch: import_koishi17.Schema.boolean().default(false)
4384
+ autoRecallTips: import_koishi18.Schema.boolean().default(true),
4385
+ rankBroadSwitch: import_koishi18.Schema.boolean().default(false)
4246
4386
  }).i18n(getI18n("message")),
4247
- import_koishi17.Schema.union([
4248
- import_koishi17.Schema.object({
4249
- rankBroadSwitch: import_koishi17.Schema.const(true).required(),
4250
- rankBroadStar: import_koishi17.Schema.boolean().default(true),
4251
- rankBroadLeader: import_koishi17.Schema.boolean().default(true),
4252
- rankBroadFun: import_koishi17.Schema.boolean().default(false)
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)
4253
4393
  }),
4254
- import_koishi17.Schema.object({})
4394
+ import_koishi18.Schema.object({})
4255
4395
  ]).i18n(getI18n("message"))
4256
4396
  ]),
4257
- import_koishi17.Schema.intersect([
4258
- import_koishi17.Schema.object({
4259
- dailyReportSwitch: import_koishi17.Schema.boolean().default(false)
4397
+ import_koishi18.Schema.intersect([
4398
+ import_koishi18.Schema.object({
4399
+ dailyReportSwitch: import_koishi18.Schema.boolean().default(false)
4260
4400
  }).i18n(getI18n("report")),
4261
- import_koishi17.Schema.union([
4262
- import_koishi17.Schema.object({
4263
- dailyReportSwitch: import_koishi17.Schema.const(true).required(),
4264
- dailyReportHours: import_koishi17.Schema.number().min(0).max(23).default(6),
4265
- dailyReportShowCombi: import_koishi17.Schema.boolean().default(true)
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)
4266
4406
  }),
4267
- import_koishi17.Schema.object({})
4407
+ import_koishi18.Schema.object({})
4268
4408
  ]).i18n(getI18n("report")),
4269
- import_koishi17.Schema.object({
4270
- weeklyReportSwitch: import_koishi17.Schema.boolean().default(false)
4409
+ import_koishi18.Schema.object({
4410
+ weeklyReportSwitch: import_koishi18.Schema.boolean().default(false)
4271
4411
  }).i18n(getI18n("report")).description(void 0),
4272
- import_koishi17.Schema.union([
4273
- import_koishi17.Schema.object({
4274
- weeklyReportSwitch: import_koishi17.Schema.const(true).required(),
4275
- weeklyReportDayHours: import_koishi17.Schema.tuple([import_koishi17.Schema.number().min(1).max(7), import_koishi17.Schema.number().min(0).max(23)]).default([1, 10]),
4276
- weeklyReportShowCombi: import_koishi17.Schema.boolean().default(true)
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)
4277
4417
  }),
4278
- import_koishi17.Schema.object({})
4418
+ import_koishi18.Schema.object({})
4279
4419
  ]).i18n(getI18n("report"))
4280
4420
  ]),
4281
- import_koishi17.Schema.object({
4282
- template_match: import_koishi17.Schema.union([...readDirectoryFilesSync(import_path4.default.join(templateDir, "match"))]).default("match_1"),
4283
- template_player: import_koishi17.Schema.union([...readDirectoryFilesSync(import_path4.default.join(templateDir, "player"))]).default("player_1"),
4284
- template_hero: import_koishi17.Schema.union([...readDirectoryFilesSync(import_path4.default.join(templateDir, "hero"))]).default("hero_1"),
4285
- playerRankEstimate: import_koishi17.Schema.boolean().default(true),
4286
- templateFonts: import_koishi17.Schema.array(String).default([]).role("table")
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")
4287
4427
  }).i18n(getI18n("template"))
4288
4428
  ]);
4289
4429
  function getI18n(key) {
@@ -4299,7 +4439,7 @@ __name(getI18n, "getI18n");
4299
4439
  function readDirectoryFilesSync(directoryPath) {
4300
4440
  try {
4301
4441
  const files = import_fs3.default.readdirSync(directoryPath);
4302
- const fileNames = files.filter((file) => import_path4.default.extname(file).toLowerCase() === ".ejs").map((file) => import_path4.default.basename(file, ".ejs"));
4442
+ const fileNames = files.filter((file) => import_path3.default.extname(file).toLowerCase() === ".ejs").map((file) => import_path3.default.basename(file, ".ejs"));
4303
4443
  return fileNames;
4304
4444
  } catch (error) {
4305
4445
  console.error("Error reading directory:", error);
@@ -4319,19 +4459,19 @@ async function apply(ctx, config) {
4319
4459
  const lib = await import("dotaconstants");
4320
4460
  const dotaconstants = lib.default || lib;
4321
4461
  const logger = ctx.logger("dota2tracker");
4322
- const currentDir = import_path5.default.resolve(__dirname);
4323
- const pluginVersion = require(import_path5.default.join(currentDir, "..", "package.json")).version;
4462
+ const currentDir = import_path4.default.resolve(__dirname);
4463
+ const pluginVersion = require(import_path4.default.join(currentDir, "..", "package.json")).version;
4324
4464
  ctx.dota2tracker = {};
4325
4465
  ctx.dota2tracker.dotaconstants = dotaconstants;
4326
4466
  ctx.dota2tracker.i18n = new I18NService(ctx);
4327
- ctx.dota2tracker.image = new ImageRenderer(ctx, currentDir);
4467
+ ctx.dota2tracker.view = new ViewRenderer(ctx, currentDir);
4328
4468
  ctx.dota2tracker.messageBuilder = new MessageBuilder(ctx);
4329
4469
  ctx.dota2tracker.match = new MatchService(ctx, pluginVersion);
4330
4470
  ctx.dota2tracker.player = new PlayerService(ctx);
4331
4471
  if (ctx.cron) {
4332
4472
  ctx.dota2tracker.matchWatcher = new MatchWatcherTask(ctx);
4333
4473
  ctx.dota2tracker.parsePolling = new ParsePollingTask(ctx);
4334
- ctx.dota2tracker.report = new ReportTask(ctx);
4474
+ ctx.dota2tracker.reportTask = new ReportTask(ctx);
4335
4475
  ctx.cron("* * * * *", async () => {
4336
4476
  await ctx.dota2tracker.matchWatcher.discovery();
4337
4477
  await ctx.dota2tracker.parsePolling.polling();
@@ -4341,6 +4481,7 @@ async function apply(ctx, config) {
4341
4481
  }
4342
4482
  ctx.dota2tracker.hero = new HeroService(ctx);
4343
4483
  ctx.dota2tracker.item = new ItemService(ctx);
4484
+ ctx.dota2tracker.report = new ReportService(ctx);
4344
4485
  ctx.dota2tracker.cache = new CacheService(ctx);
4345
4486
  ctx.dota2tracker.database = new DatabaseService(ctx);
4346
4487
  ctx.dota2tracker.valveAPI = new ValveAPI(ctx);
@@ -4360,7 +4501,6 @@ async function apply(ctx, config) {
4360
4501
  registerQueryHeroCommand(ctx);
4361
4502
  registerQueryItemCommand(ctx);
4362
4503
  registerHeroOfTheDayCommand(ctx);
4363
- if (ctx.console && config.enableConsole) registerConsolePage(ctx);
4364
4504
  }
4365
4505
  __name(apply, "apply");
4366
4506
  // Annotate the CommonJS export names for ESM import in node: