@sjtdev/koishi-plugin-dota2tracker 2.3.1 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +38 -0
- package/lib/index.js +263 -161
- package/lib/templates/hero/hero_1/base.css +1 -0
- package/lib/templates/hero/hero_1.ejs +1 -1
- package/lib/templates/images/dotamap_7.40.png +0 -0
- package/lib/templates/match/match_2+/extra.css +1 -1
- package/lib/templates/match/match_2+/map.ejs +51 -49
- package/lib/templates/report/daily.ejs +0 -8
- package/package.json +2 -5
- package/dist/index.js +0 -1
- package/lib/templates/images/7.38_simple_minimap.png +0 -0
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.', 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
|
|
|
@@ -789,21 +789,21 @@ var require_en_US_template = __commonJS({
|
|
|
789
789
|
// src/locales/en-US.yml
|
|
790
790
|
var require_en_US = __commonJS({
|
|
791
791
|
"src/locales/en-US.yml"(exports2, module2) {
|
|
792
|
-
module2.exports = { dota2tracker: { heroes_nicknames: { "0": 'Please strictly follow the format of "", "" when filling out, if the format is incorrect, only the default name of the hero will be used. The default name of the hero may be omitted.', "1": '"Anti-Mage"', "2": '"Axe"', "3": '"Bane"', "4": '"Bloodseeker"', "5": '"Crystal Maiden"', "6": '"Drow Ranger"', "7": '"Earthshaker"', "8": '"Juggernaut"', "9": '"Mirana"', "10": '"Morphling"', "11": '"Shadow Fiend"', "12": '"Phantom Lancer"', "13": '"Puck"', "14": '"Pudge"', "15": '"Razor"', "16": '"Sand King"', "17": '"Storm Spirit"', "18": '"Sven"', "19": '"Tiny"', "20": '"Vengeful Spirit"', "21": '"Windranger"', "22": '"Zeus"', "23": '"Kunkka"', "25": '"Lina"', "26": '"Lion"', "27": '"Shadow Shaman"', "28": '"Slardar"', "29": '"Tidehunter"', "30": '"Witch Doctor"', "31": '"Lich"', "32": '"Riki"', "33": '"Enigma"', "34": '"Tinker"', "35": '"Sniper"', "36": '"Necrophos"', "37": '"Warlock"', "38": '"Beastmaster"', "39": '"Queen of Pain"', "40": '"Venomancer"', "41": '"Faceless Void"', "42": '"Wraith King"', "43": '"Death Prophet"', "44": '"Phantom Assassin"', "45": '"Pugna"', "46": '"Templar Assassin"', "47": '"Viper"', "48": '"Luna"', "49": '"Dragon Knight"', "50": '"Dazzle"', "51": '"Clockwerk"', "52": '"Leshrac"', "53": `"Nature's Prophet"`, "54": '"Lifestealer"', "55": '"Dark Seer"', "56": '"Clinkz"', "57": '"Omniknight"', "58": '"Enchantress"', "59": '"Huskar"', "60": '"Night Stalker"', "61": '"Broodmother"', "62": '"Bounty Hunter"', "63": '"Weaver"', "64": '"Jakiro"', "65": '"Batrider"', "66": '"Chen"', "67": '"Spectre"', "68": '"Ancient Apparition"', "69": '"Doom"', "70": '"Ursa"', "71": '"Spirit Breaker"', "72": '"Gyrocopter"', "73": '"Alchemist"', "74": '"Invoker"', "75": '"Silencer"', "76": '"Outworld Devourer"', "77": '"Lycan"', "78": '"Brewmaster"', "79": '"Shadow Demon"', "80": '"Lone Druid"', "81": '"Chaos Knight"', "82": '"Meepo"', "83": '"Treant Protector"', "84": '"Ogre Magi"', "85": '"Undying"', "86": '"Rubick"', "87": '"Disruptor"', "88": '"Nyx Assassin"', "89": '"Naga Siren"', "90": '"Keeper of the Light"', "91": '"Io"', "92": '"Visage"', "93": '"Slark"', "94": '"Medusa"', "95": '"Troll Warlord"', "96": '"Centaur Warrunner"', "97": '"Magnus"', "98": '"Timbersaw"', "99": '"Bristleback"', "100": '"Tusk"', "101": '"Skywrath Mage"', "102": '"Abaddon"', "103": '"Elder Titan"', "104": '"Legion Commander"', "105": '"Techies"', "106": '"Ember Spirit"', "107": '"Earth Spirit"', "108": '"Underlord"', "109": '"Terrorblade"', "110": '"Phoenix"', "111": '"Oracle"', "112": '"Winter Wyvern"', "113": '"Arc Warden"', "114": '"Monkey King"', "119": '"Dark Willow"', "120": '"Pangolier"', "121": '"Grimstroke"', "123": '"Hoodwink"', "126": '"Void Spirit"', "128": '"Snapfire"', "129": '"Mars"', "131": '"Ring Master"', "135": '"Dawnbreaker"', "136": '"Marci"', "137": '"Primal Beast"', "138": '"Muerta"', "145": '"Kez"' }, broadcast: { WIN_NEGATIVE: `"Won the match by sheer luck", "Won the match by a stroke of bad luck", "Coasted to victory", "Didn't even show up for the team fight, but my teammates won 4v5"`, WIN_POSITIVE: '"Led the team to victory", "Dominated the opponents and secured the win", "Carried the game to victory", "Treated the opponents like pigs and won", "Won again; this game is just so monotonous and dull", "Simply achieved a win in the match"', LOSE_NEGATIVE: '"Got crushed and lost the match", "Lost the match miserably", "Got my head knocked sideways and lost the match with a blown mindset", "Went fishing but got eaten by the fish, lost the match", "Played terribly", "Simply suffered a loss in the match"', LOSE_POSITIVE: `"Lost the match with no way to turn it around", "Gave it my all, but still lost the match", "Though we lost, we still have honor", "Couldn't carry my teammates, lost the match", "Lost again, it hurts; I'd rather it be me losing"`, message: "{name}'s {hero_name} {comment}.\nKDA: {kda}, GPM/XPM: {gpm_xpm}, Last Hits/Denies: {lh_dn}, Damage/Tower Damage: {damage}, Kill/Death Contribution Rate: {kc_dc}", rank_changed: "Player {name} rank changed: {prev.medal} {prev.star} → {curr.medal} {curr.star}" }, logger: { fetch_guilds_failed: "Failed to fetch guild information.", match_tracked: "Tracked new match {match.id} from {#each messageToLogger as item}users in guild {item.platform}:{item.guildId} [{#each item.players as player}{player.nickname}({player.steamId}){#if player !== item.players[item.players.length - 1]}, {/if}{/each}]{#if item !== messageToLogger[messageToLogger.length - 1]}, {/if}{/each}.", parse_request_sent: "The parsing request for match {matchId} has been successfully sent to the STRATZ server.", parse_request_failed: "The parsing request for match {matchId} failed to send.", match_parsed: "Match {matchId} has been parsed{#if odParsed} by OpenDota{/if}, an image was generated and published to {#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}, {/if}{/each}.", match_unparsed: "Match {matchId} exceeded the waiting time [{timeout}] and remains unparsed, an image was generated and published to {#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}, {/if}{/each}.", waiting_for_parse: "Match {matchId} has not been parsed yet, has been waiting for {time} minutes.", report_sent: "Posted {title} on {platform}:{guildId}.", rank_sent: "Posted rank change information of {player.nickName} ({player.steamId}) on {platform}:{guildId}.", ejs_error: "Error rendering EJS template: {error}", cron_not_enabled: "Cron service is not enabled; match report tracking cannot run.", stratz_token_banned: "Stratz API request rejected (403). This usually means your token or IP has been temporarily restricted due to unusual activity. For details, see the documentation: http://sjtdev.github.io/koishi-plugin-dota2tracker/en-US/api-403.html", opendota_token_banned: "OpenDota API request rejected (403). Please check if the access limit has been exceeded.", stratz_api_query_error: "Stratz API returned partial data with errors: {cause}", opendota_parse_request_sent: "Parse request for match {matchId} has been sent to OpenDota servers successfully.", opendota_parse_request_failed: "Failed to send parse request for match {matchId} to OpenDota servers." }, time: { years_months_ago: "{years} years and {months} months ago", years_ago: "{years} years ago" } } };
|
|
792
|
+
module2.exports = { dota2tracker: { heroes_nicknames: { "0": 'Please strictly follow the format of "", "" when filling out, if the format is incorrect, only the default name of the hero will be used. The default name of the hero may be omitted.', "1": '"Anti-Mage"', "2": '"Axe"', "3": '"Bane"', "4": '"Bloodseeker"', "5": '"Crystal Maiden"', "6": '"Drow Ranger"', "7": '"Earthshaker"', "8": '"Juggernaut"', "9": '"Mirana"', "10": '"Morphling"', "11": '"Shadow Fiend"', "12": '"Phantom Lancer"', "13": '"Puck"', "14": '"Pudge"', "15": '"Razor"', "16": '"Sand King"', "17": '"Storm Spirit"', "18": '"Sven"', "19": '"Tiny"', "20": '"Vengeful Spirit"', "21": '"Windranger"', "22": '"Zeus"', "23": '"Kunkka"', "25": '"Lina"', "26": '"Lion"', "27": '"Shadow Shaman"', "28": '"Slardar"', "29": '"Tidehunter"', "30": '"Witch Doctor"', "31": '"Lich"', "32": '"Riki"', "33": '"Enigma"', "34": '"Tinker"', "35": '"Sniper"', "36": '"Necrophos"', "37": '"Warlock"', "38": '"Beastmaster"', "39": '"Queen of Pain"', "40": '"Venomancer"', "41": '"Faceless Void"', "42": '"Wraith King"', "43": '"Death Prophet"', "44": '"Phantom Assassin"', "45": '"Pugna"', "46": '"Templar Assassin"', "47": '"Viper"', "48": '"Luna"', "49": '"Dragon Knight"', "50": '"Dazzle"', "51": '"Clockwerk"', "52": '"Leshrac"', "53": `"Nature's Prophet"`, "54": '"Lifestealer"', "55": '"Dark Seer"', "56": '"Clinkz"', "57": '"Omniknight"', "58": '"Enchantress"', "59": '"Huskar"', "60": '"Night Stalker"', "61": '"Broodmother"', "62": '"Bounty Hunter"', "63": '"Weaver"', "64": '"Jakiro"', "65": '"Batrider"', "66": '"Chen"', "67": '"Spectre"', "68": '"Ancient Apparition"', "69": '"Doom"', "70": '"Ursa"', "71": '"Spirit Breaker"', "72": '"Gyrocopter"', "73": '"Alchemist"', "74": '"Invoker"', "75": '"Silencer"', "76": '"Outworld Devourer"', "77": '"Lycan"', "78": '"Brewmaster"', "79": '"Shadow Demon"', "80": '"Lone Druid"', "81": '"Chaos Knight"', "82": '"Meepo"', "83": '"Treant Protector"', "84": '"Ogre Magi"', "85": '"Undying"', "86": '"Rubick"', "87": '"Disruptor"', "88": '"Nyx Assassin"', "89": '"Naga Siren"', "90": '"Keeper of the Light"', "91": '"Io"', "92": '"Visage"', "93": '"Slark"', "94": '"Medusa"', "95": '"Troll Warlord"', "96": '"Centaur Warrunner"', "97": '"Magnus"', "98": '"Timbersaw"', "99": '"Bristleback"', "100": '"Tusk"', "101": '"Skywrath Mage"', "102": '"Abaddon"', "103": '"Elder Titan"', "104": '"Legion Commander"', "105": '"Techies"', "106": '"Ember Spirit"', "107": '"Earth Spirit"', "108": '"Underlord"', "109": '"Terrorblade"', "110": '"Phoenix"', "111": '"Oracle"', "112": '"Winter Wyvern"', "113": '"Arc Warden"', "114": '"Monkey King"', "119": '"Dark Willow"', "120": '"Pangolier"', "121": '"Grimstroke"', "123": '"Hoodwink"', "126": '"Void Spirit"', "128": '"Snapfire"', "129": '"Mars"', "131": '"Ring Master"', "135": '"Dawnbreaker"', "136": '"Marci"', "137": '"Primal Beast"', "138": '"Muerta"', "145": '"Kez"', "155": '"Largo"' }, broadcast: { WIN_NEGATIVE: `"Won the match by sheer luck", "Won the match by a stroke of bad luck", "Coasted to victory", "Didn't even show up for the team fight, but my teammates won 4v5"`, WIN_POSITIVE: '"Led the team to victory", "Dominated the opponents and secured the win", "Carried the game to victory", "Treated the opponents like pigs and won", "Won again; this game is just so monotonous and dull", "Simply achieved a win in the match"', LOSE_NEGATIVE: '"Got crushed and lost the match", "Lost the match miserably", "Got my head knocked sideways and lost the match with a blown mindset", "Went fishing but got eaten by the fish, lost the match", "Played terribly", "Simply suffered a loss in the match"', LOSE_POSITIVE: `"Lost the match with no way to turn it around", "Gave it my all, but still lost the match", "Though we lost, we still have honor", "Couldn't carry my teammates, lost the match", "Lost again, it hurts; I'd rather it be me losing"`, message: "{name}'s {hero_name} {comment}.\nKDA: {kda}, GPM/XPM: {gpm_xpm}, Last Hits/Denies: {lh_dn}, Damage/Tower Damage: {damage}, Kill/Death Contribution Rate: {kc_dc}", rank_changed: "Player {name} rank changed: {prev.medal} {prev.star} → {curr.medal} {curr.star}" }, logger: { fetch_guilds_failed: "Failed to fetch guild information.", match_tracked: "Tracked new match {match.id} from {#each messageToLogger as item}users in guild {item.platform}:{item.guildId} [{#each item.players as player}{player.nickname}({player.steamId}){#if player !== item.players[item.players.length - 1]}, {/if}{/each}]{#if item !== messageToLogger[messageToLogger.length - 1]}, {/if}{/each}.", parse_request_sent: "The parsing request for match {matchId} has been successfully sent to the STRATZ server.", parse_request_failed: "The parsing request for match {matchId} failed to send.", match_parsed: "Match {matchId} has been parsed{#if odParsed} by OpenDota{/if}, an image was generated and published to {#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}, {/if}{/each}.", match_unparsed: "Match {matchId} exceeded the waiting time [{timeout}] and remains unparsed, an image was generated and published to {#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}, {/if}{/each}.", waiting_for_parse: "Match {matchId} has not been parsed yet, has been waiting for {time} minutes.", report_sent: "Posted {title} on {platform}:{guildId}.", rank_sent: "Posted rank change information of {player.nickName} ({player.steamId}) on {platform}:{guildId}.", ejs_error: "Error rendering EJS template: {error}", cron_not_enabled: "Cron service is not enabled; match report tracking cannot run.", stratz_token_banned: "Stratz API request rejected (403). This usually means your token or IP has been temporarily restricted due to unusual activity. For details, see the documentation: http://sjtdev.github.io/koishi-plugin-dota2tracker/en-US/api-403.html", opendota_token_banned: "OpenDota API request rejected (403). Please check if the access limit has been exceeded.", stratz_api_query_error: "Stratz API returned partial data with errors: {cause}", opendota_parse_request_sent: "Parse request for match {matchId} has been sent to OpenDota servers successfully.", opendota_parse_request_failed: "Failed to send parse request for match {matchId} to OpenDota servers." }, time: { years_months_ago: "{years} years and {months} months ago", years_ago: "{years} years ago" } } };
|
|
793
793
|
}
|
|
794
794
|
});
|
|
795
795
|
|
|
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查看所有可用指令。", 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
|
|
|
@@ -817,7 +817,7 @@ var require_zh_CN_template = __commonJS({
|
|
|
817
817
|
// src/locales/zh-CN.yml
|
|
818
818
|
var require_zh_CN = __commonJS({
|
|
819
819
|
"src/locales/zh-CN.yml"(exports2, module2) {
|
|
820
|
-
module2.exports = { dota2tracker: { heroes_nicknames: { "0": '请严格遵循 "", "" 格式填写(如下方默认数据,注意是英文半角符号),如果格式有误将仅使用英雄默认名称。可以不包含英雄默认名称。', "1": '"敌法师", "敌法", "AM"', "2": '"斧王"', "3": '"祸乱之源", "祸乱", "水桶腰"', "4": '"血魔"', "5": '"水晶室女", "冰女", "CM"', "6": '"卓尔游侠", "小黑"', "7": '"撼地者", "小牛", "牛头"', "8": '"主宰", "剑圣", "jugg", "奶棒人"', "9": '"米拉娜", "白虎", "pom"', "10": '"变体精灵", "水人"', "11": '"影魔", "影魔王", "SF", "影儿魔儿"', "12": '"幻影长矛手", "PL"', "13": '"帕克"', "14": '"帕吉", "屠夫", "扒鸡", "啪唧"', "15": '"雷泽", "电魂", "电棍"', "16": '"沙王", "SK"', "17": '"风暴之灵", "蓝猫"', "18": '"斯温", "流浪剑客", "流浪"', "19": '"小小"', "20": '"复仇之魂", "复仇", "VS"', "21": '"风行者", "风行", "WR"', "22": '"宙斯"', "23": '"昆卡", "船长"', "25": '"莉娜", "火女"', "26": '"莱恩", "恶魔巫师", "Lion"', "27": '"暗影萨满", "小Y", "小歪"', "28": '"斯拉达", "大鱼", "大鱼人"', "29": '"潮汐猎人", "潮汐", "西瓜皮"', "30": '"巫医"', "31": '"巫妖"', "32": '"力丸", "隐形刺客", "隐刺"', "33": '"谜团"', "34": '"修补匠", "TK", "Tinker"', "35": '"狙击手", "矮人火枪手", "火枪", "传说哥"', "36": '"瘟疫法师", "死灵法", "NEC"', "37": '"术士", "Warlock"', "38": '"兽王"', "39": '"痛苦女王", "女王", "QOP"', "40": '"剧毒术士", "剧毒"', "41": '"虚空假面", "虚空", "JB脸"', "42": '"冥魂大帝", "骷髅王"', "43": '"死亡先知", "DP"', "44": '"幻影刺客", "幻刺", "PA"', "45": '"帕格纳", "骨法", "湮灭法师"', "46": '"圣堂刺客", "圣堂", "TA"', "47": '"冥界亚龙", "毒龙", "Viper"', "48": '"露娜", "月骑", "Luna"', "49": '"龙骑士", "龙骑"', "50": '"戴泽", "暗影牧师", "暗牧"', "51": '"发条技师", "发条"', "52": '"拉席克", "老鹿"', "53": '"先知"', "54": '"噬魂鬼", "小狗"', "55": '"黑暗贤者", "黑贤"', "56": '"克林克兹", "小骷髅"', "57": '"全能骑士", "全能"', "58": '"魅惑魔女", "小鹿"', "59": '"哈斯卡", "神灵", "神灵武士"', "60": '"暗夜魔王", "夜魔"', "61": '"育母蜘蛛", "蜘蛛"', "62": '"赏金猎人", "赏金"', "63": '"编织者", "蚂蚁"', "64": '"杰奇洛", "双头龙"', "65": '"蝙蝠骑士", "蝙蝠"', "66": '"陈", "老陈"', "67": '"幽鬼", "SPE", "UG"', "68": '"远古冰魄", "冰魂"', "69": '"末日使者", "末日", "Doom"', "70": '"熊战士", "拍拍", "拍拍熊"', "71": '"裂魂人", "白牛", "sb"', "72": '"矮人直升机", "飞机"', "73": '"炼金术士", "炼金"', "74": '"祈求者", "卡尔"', "75": '"沉默术士", "沉默"', "76": '"殁境神蚀者", "黑鸟"', "77": '"狼人"', "78": '"酒仙", "熊猫", "熊猫酒仙"', "79": '"暗影恶魔", "毒狗"', "80": '"德鲁伊", "熊德"', "81": '"混沌骑士", "混沌", "CK"', "82": '"米波"', "83": '"树精卫士", "大树", "树精"', "84": '"食人魔魔法师", "蓝胖"', "85": '"不朽尸王", "尸王"', "86": '"拉比克"', "87": '"干扰者", "萨尔"', "88": '"司夜刺客", "小强"', "89": '"娜迦海妖", "小娜迦"', "90": '"光之守卫", "光法"', "91": '"艾欧", "小精灵", "精灵", "IO"', "92": '"维萨吉", "死灵龙", "死灵飞龙"', "93": '"斯拉克", "小鱼", "小鱼人"', "94": '"美杜莎", "一姐", "美杜莎"', "95": '"巨魔战将", "巨魔", "巨馍蘸酱"', "96": '"半人马战行者", "人马", "半人马"', "97": '"马格纳斯", "猛犸"', "98": '"伐木机", "花母鸡"', "99": '"钢背兽", "钢背"', "100": '"巨牙海民", "海民"', "101": '"天怒法师", "天怒"', "102": '"亚巴顿"', "103": '"上古巨神", "大牛"', "104": '"军团指挥官", "军团"', "105": '"工程师", "炸弹", "炸弹人"', "106": '"灰烬之灵", "火猫"', "107": '"大地之灵", "土猫"', "108": '"孽主", "大屁股"', "109": '"恐怖利刃", "TB"', "110": '"凤凰", "烧鸡"', "111": '"神谕者", "神谕"', "112": '"寒冬飞龙", "冰龙"', "113": '"天穹守望者", "电狗"', "114": '"齐天大圣", "大圣"', "119": '"邪影芳灵", "小仙女", "花仙子"', "120": '"石鳞剑士", "滚滚"', "121": '"天涯墨客", "墨客"', "123": '"森海飞霞", "松鼠", "小松鼠", "小松许"', "126": '"虚无之灵", "紫猫"', "128": '"电炎绝手", "老奶奶"', "129": '"玛尔斯"', "131": '"百戏大王"', "135": '"破晓辰星", "大锤"', "136": '"玛西"', "137": '"獸", "畜"', "138": '"琼英碧灵", "奶绿", "绿奶奶"', "145": '"凯", "鸟人"' }, broadcast: { WIN_NEGATIVE: '"侥幸赢得了比赛", "走狗屎运赢得了比赛", "躺赢了比赛", "打团都没来, 队友4V5赢得了比赛"', WIN_POSITIVE: '"带领团队走向了胜利", "暴打对面后赢得了胜利", " CARRY全场赢得了胜利", "把对面当猪宰了, 赢得了胜利", "又赢了, 这游戏就是这么枯燥, 且乏味", "直接进行一个比赛的赢"', LOSE_NEGATIVE: '"被人按在地上摩擦, 输掉了这场比赛", "悲惨地输掉了比赛", "头都被打歪了, 心态爆炸地输掉了比赛", "捕鱼被鱼吃了, 输掉了比赛", "打的是个几把", "直接进行一个比赛的输"', LOSE_POSITIVE: '"无力回天输掉了比赛", "尽力了, 但还是输了比赛", "背靠世界树, 虽败犹荣", "带不动队友, 输了比赛", "又输了, 很难受, 宁愿输的是我"', message: "{name}的{hero_name}{comment}。\nKDA:{kda},GPM/XPM:{gpm_xpm},补刀/反补:{lh_dn},伤害/塔伤:{damage},参战/参葬率:{kc_dc}", rank_changed: "群友 {name} 段位变动:{prev.medal}{prev.star} → {curr.medal}{curr.star}" }, logger: { fetch_guilds_failed: "获取群组信息失败,将继续后续步骤。", match_tracked: "追踪到最新比赛 {match.id} 来自{#each messageToLogger as item}群组 {item.platform}:{item.guildId} 的玩家 [{#each item.players as player}{player.nickname}({player.steamId}){#if player !== item.players[item.players.length - 1]}、{/if}{/each}]{#if item !== messageToLogger[messageToLogger.length - 1]}、{/if}{/each}。", parse_request_sent: "比赛 {matchId} 解析请求已成功发送至STRATZ服务器。", parse_request_failed: "比赛 {matchId} 解析请求发送失败。", match_parsed: "比赛 {matchId} 已{#if odParsed}由 OpenDota {/if}解析,生成图片并发布于{#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}、{/if}{/each}。", match_unparsed: "比赛 {matchId} 超过等待时间[{timeout}分钟]仍未解析,生成图片并发布于{#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}、{/if}{/each}。", waiting_for_parse: "比赛 {matchId} 尚未解析完成,已等待{time}分钟。", report_sent: "发布{title}于{platform}:{guildId}。", rank_sent: "向{platform}:{guildId}发布{player.nickName}({player.steamId})的段位变动信息。", ejs_error: "EJS模板渲染错误:{error}", cron_not_enabled: "未启用cron服务,无法运行战报追踪等定时任务。", stratz_token_banned: "Stratz API 请求被拒绝(403),若频繁发生很有可能意味着您的Token或IP因异常使用被临时限制访问。有关此报错请见文档:http://sjtdev.github.io/koishi-plugin-dota2tracker/api-403.html", opendota_token_banned: "OpenDota API 请求被拒绝(403),请注意访问次数是否超限。", stratz_api_query_error: "Stratz API 返回了有效数据,但同时也返回了查询报错。错误信息: {cause}", opendota_parse_request_sent: "比赛 {matchId} 解析请求已成功发送至 OpenDota 服务器。", opendota_parse_request_failed: "比赛 {matchId} 解析请求向 OpenDota 服务器发送失败。" }, time: { years_months_ago: "{years}年{months}个月前", years_ago: "{years}年前" } } };
|
|
820
|
+
module2.exports = { dota2tracker: { heroes_nicknames: { "0": '请严格遵循 "", "" 格式填写(如下方默认数据,注意是英文半角符号),如果格式有误将仅使用英雄默认名称。可以不包含英雄默认名称。', "1": '"敌法师", "敌法", "AM"', "2": '"斧王"', "3": '"祸乱之源", "祸乱", "水桶腰"', "4": '"血魔"', "5": '"水晶室女", "冰女", "CM"', "6": '"卓尔游侠", "小黑"', "7": '"撼地者", "小牛", "牛头"', "8": '"主宰", "剑圣", "jugg", "奶棒人"', "9": '"米拉娜", "白虎", "pom"', "10": '"变体精灵", "水人"', "11": '"影魔", "影魔王", "SF", "影儿魔儿"', "12": '"幻影长矛手", "PL"', "13": '"帕克"', "14": '"帕吉", "屠夫", "扒鸡", "啪唧"', "15": '"雷泽", "电魂", "电棍"', "16": '"沙王", "SK"', "17": '"风暴之灵", "蓝猫"', "18": '"斯温", "流浪剑客", "流浪"', "19": '"小小"', "20": '"复仇之魂", "复仇", "VS"', "21": '"风行者", "风行", "WR"', "22": '"宙斯"', "23": '"昆卡", "船长"', "25": '"莉娜", "火女"', "26": '"莱恩", "恶魔巫师", "Lion"', "27": '"暗影萨满", "小Y", "小歪"', "28": '"斯拉达", "大鱼", "大鱼人"', "29": '"潮汐猎人", "潮汐", "西瓜皮"', "30": '"巫医"', "31": '"巫妖"', "32": '"力丸", "隐形刺客", "隐刺"', "33": '"谜团"', "34": '"修补匠", "TK", "Tinker"', "35": '"狙击手", "矮人火枪手", "火枪", "传说哥"', "36": '"瘟疫法师", "死灵法", "NEC"', "37": '"术士", "Warlock"', "38": '"兽王"', "39": '"痛苦女王", "女王", "QOP"', "40": '"剧毒术士", "剧毒"', "41": '"虚空假面", "虚空", "JB脸"', "42": '"冥魂大帝", "骷髅王"', "43": '"死亡先知", "DP"', "44": '"幻影刺客", "幻刺", "PA"', "45": '"帕格纳", "骨法", "湮灭法师"', "46": '"圣堂刺客", "圣堂", "TA"', "47": '"冥界亚龙", "毒龙", "Viper"', "48": '"露娜", "月骑", "Luna"', "49": '"龙骑士", "龙骑"', "50": '"戴泽", "暗影牧师", "暗牧"', "51": '"发条技师", "发条"', "52": '"拉席克", "老鹿"', "53": '"先知"', "54": '"噬魂鬼", "小狗"', "55": '"黑暗贤者", "黑贤"', "56": '"克林克兹", "小骷髅"', "57": '"全能骑士", "全能"', "58": '"魅惑魔女", "小鹿"', "59": '"哈斯卡", "神灵", "神灵武士"', "60": '"暗夜魔王", "夜魔"', "61": '"育母蜘蛛", "蜘蛛"', "62": '"赏金猎人", "赏金"', "63": '"编织者", "蚂蚁"', "64": '"杰奇洛", "双头龙"', "65": '"蝙蝠骑士", "蝙蝠"', "66": '"陈", "老陈"', "67": '"幽鬼", "SPE", "UG"', "68": '"远古冰魄", "冰魂"', "69": '"末日使者", "末日", "Doom"', "70": '"熊战士", "拍拍", "拍拍熊"', "71": '"裂魂人", "白牛", "sb"', "72": '"矮人直升机", "飞机"', "73": '"炼金术士", "炼金"', "74": '"祈求者", "卡尔"', "75": '"沉默术士", "沉默"', "76": '"殁境神蚀者", "黑鸟"', "77": '"狼人"', "78": '"酒仙", "熊猫", "熊猫酒仙"', "79": '"暗影恶魔", "毒狗"', "80": '"德鲁伊", "熊德"', "81": '"混沌骑士", "混沌", "CK"', "82": '"米波"', "83": '"树精卫士", "大树", "树精"', "84": '"食人魔魔法师", "蓝胖"', "85": '"不朽尸王", "尸王"', "86": '"拉比克"', "87": '"干扰者", "萨尔"', "88": '"司夜刺客", "小强"', "89": '"娜迦海妖", "小娜迦"', "90": '"光之守卫", "光法"', "91": '"艾欧", "小精灵", "精灵", "IO"', "92": '"维萨吉", "死灵龙", "死灵飞龙"', "93": '"斯拉克", "小鱼", "小鱼人"', "94": '"美杜莎", "一姐", "美杜莎"', "95": '"巨魔战将", "巨魔", "巨馍蘸酱"', "96": '"半人马战行者", "人马", "半人马"', "97": '"马格纳斯", "猛犸"', "98": '"伐木机", "花母鸡"', "99": '"钢背兽", "钢背"', "100": '"巨牙海民", "海民"', "101": '"天怒法师", "天怒"', "102": '"亚巴顿"', "103": '"上古巨神", "大牛"', "104": '"军团指挥官", "军团"', "105": '"工程师", "炸弹", "炸弹人"', "106": '"灰烬之灵", "火猫"', "107": '"大地之灵", "土猫"', "108": '"孽主", "大屁股"', "109": '"恐怖利刃", "TB"', "110": '"凤凰", "烧鸡"', "111": '"神谕者", "神谕"', "112": '"寒冬飞龙", "冰龙"', "113": '"天穹守望者", "电狗"', "114": '"齐天大圣", "大圣"', "119": '"邪影芳灵", "小仙女", "花仙子"', "120": '"石鳞剑士", "滚滚"', "121": '"天涯墨客", "墨客"', "123": '"森海飞霞", "松鼠", "小松鼠", "小松许"', "126": '"虚无之灵", "紫猫"', "128": '"电炎绝手", "老奶奶"', "129": '"玛尔斯"', "131": '"百戏大王"', "135": '"破晓辰星", "大锤"', "136": '"玛西"', "137": '"獸", "畜"', "138": '"琼英碧灵", "奶绿", "绿奶奶"', "145": '"凯", "鸟人"', "155": '"朗戈"' }, broadcast: { WIN_NEGATIVE: '"侥幸赢得了比赛", "走狗屎运赢得了比赛", "躺赢了比赛", "打团都没来, 队友4V5赢得了比赛"', WIN_POSITIVE: '"带领团队走向了胜利", "暴打对面后赢得了胜利", " CARRY全场赢得了胜利", "把对面当猪宰了, 赢得了胜利", "又赢了, 这游戏就是这么枯燥, 且乏味", "直接进行一个比赛的赢"', LOSE_NEGATIVE: '"被人按在地上摩擦, 输掉了这场比赛", "悲惨地输掉了比赛", "头都被打歪了, 心态爆炸地输掉了比赛", "捕鱼被鱼吃了, 输掉了比赛", "打的是个几把", "直接进行一个比赛的输"', LOSE_POSITIVE: '"无力回天输掉了比赛", "尽力了, 但还是输了比赛", "背靠世界树, 虽败犹荣", "带不动队友, 输了比赛", "又输了, 很难受, 宁愿输的是我"', message: "{name}的{hero_name}{comment}。\nKDA:{kda},GPM/XPM:{gpm_xpm},补刀/反补:{lh_dn},伤害/塔伤:{damage},参战/参葬率:{kc_dc}", rank_changed: "群友 {name} 段位变动:{prev.medal}{prev.star} → {curr.medal}{curr.star}" }, logger: { fetch_guilds_failed: "获取群组信息失败,将继续后续步骤。", match_tracked: "追踪到最新比赛 {match.id} 来自{#each messageToLogger as item}群组 {item.platform}:{item.guildId} 的玩家 [{#each item.players as player}{player.nickname}({player.steamId}){#if player !== item.players[item.players.length - 1]}、{/if}{/each}]{#if item !== messageToLogger[messageToLogger.length - 1]}、{/if}{/each}。", parse_request_sent: "比赛 {matchId} 解析请求已成功发送至STRATZ服务器。", parse_request_failed: "比赛 {matchId} 解析请求发送失败。", match_parsed: "比赛 {matchId} 已{#if odParsed}由 OpenDota {/if}解析,生成图片并发布于{#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}、{/if}{/each}。", match_unparsed: "比赛 {matchId} 超过等待时间[{timeout}分钟]仍未解析,生成图片并发布于{#each guilds as guild}{guild.platform}:{guild.guildId}{#if guild !== guilds[guilds.length - 1]}、{/if}{/each}。", waiting_for_parse: "比赛 {matchId} 尚未解析完成,已等待{time}分钟。", report_sent: "发布{title}于{platform}:{guildId}。", rank_sent: "向{platform}:{guildId}发布{player.nickName}({player.steamId})的段位变动信息。", ejs_error: "EJS模板渲染错误:{error}", cron_not_enabled: "未启用cron服务,无法运行战报追踪等定时任务。", stratz_token_banned: "Stratz API 请求被拒绝(403),若频繁发生很有可能意味着您的Token或IP因异常使用被临时限制访问。有关此报错请见文档:http://sjtdev.github.io/koishi-plugin-dota2tracker/api-403.html", opendota_token_banned: "OpenDota API 请求被拒绝(403),请注意访问次数是否超限。", stratz_api_query_error: "Stratz API 返回了有效数据,但同时也返回了查询报错。错误信息: {cause}", opendota_parse_request_sent: "比赛 {matchId} 解析请求已成功发送至 OpenDota 服务器。", opendota_parse_request_failed: "比赛 {matchId} 解析请求向 OpenDota 服务器发送失败。" }, time: { years_months_ago: "{years}年{months}个月前", years_ago: "{years}年前" } } };
|
|
821
821
|
}
|
|
822
822
|
});
|
|
823
823
|
|
|
@@ -831,7 +831,7 @@ __export(src_exports, {
|
|
|
831
831
|
usage: () => usage
|
|
832
832
|
});
|
|
833
833
|
module.exports = __toCommonJS(src_exports);
|
|
834
|
-
var
|
|
834
|
+
var import_path4 = __toESM(require("path"));
|
|
835
835
|
|
|
836
836
|
// src/app/common/i18n.ts
|
|
837
837
|
var import_koishi = require("koishi");
|
|
@@ -926,9 +926,14 @@ var LanguageTags = {
|
|
|
926
926
|
"zh-CN": { graphqlTag: "S_CHINESE", valveTag: "schinese" }
|
|
927
927
|
};
|
|
928
928
|
var I18NService = class extends import_koishi.Service {
|
|
929
|
-
|
|
929
|
+
static {
|
|
930
|
+
__name(this, "I18NService");
|
|
931
|
+
}
|
|
932
|
+
constantLocales = {};
|
|
933
|
+
i18n;
|
|
934
|
+
globalLanguageTag;
|
|
935
|
+
constructor(ctx) {
|
|
930
936
|
super(ctx, "dota2tracker.i18n", true);
|
|
931
|
-
this.dotaconstants = dotaconstants;
|
|
932
937
|
this.config = ctx.config;
|
|
933
938
|
this.i18n = this.ctx.i18n;
|
|
934
939
|
for (const supportLanguageTag of Object.keys(LanguageTags)) {
|
|
@@ -939,12 +944,6 @@ var I18NService = class extends import_koishi.Service {
|
|
|
939
944
|
}
|
|
940
945
|
this.globalLanguageTag = this.i18n.fallback(Object.values(this.i18n.locales).map((locale) => Object.keys(locale).at(0))).find((locale) => Object.keys(LanguageTags).includes(locale));
|
|
941
946
|
}
|
|
942
|
-
static {
|
|
943
|
-
__name(this, "I18NService");
|
|
944
|
-
}
|
|
945
|
-
constantLocales = {};
|
|
946
|
-
i18n;
|
|
947
|
-
globalLanguageTag;
|
|
948
947
|
getGraphqlLanguageTag(languageTag) {
|
|
949
948
|
return LanguageTags[languageTag].graphqlTag;
|
|
950
949
|
}
|
|
@@ -1050,7 +1049,7 @@ var I18NService = class extends import_koishi.Service {
|
|
|
1050
1049
|
*/
|
|
1051
1050
|
_buildNicknameMap(languageTag) {
|
|
1052
1051
|
this.logger.debug(`Building nickname map for ${languageTag}...`);
|
|
1053
|
-
const heroIds = Object.keys(this.dotaconstants.heroes).map(Number);
|
|
1052
|
+
const heroIds = Object.keys(this.ctx.dota2tracker.dotaconstants.heroes).map(Number);
|
|
1054
1053
|
const nicknameMap = /* @__PURE__ */ new Map();
|
|
1055
1054
|
for (const heroId of heroIds) {
|
|
1056
1055
|
const allNames = this._getAllHeroNames(heroId, languageTag);
|
|
@@ -1065,7 +1064,7 @@ var I18NService = class extends import_koishi.Service {
|
|
|
1065
1064
|
const inputStr = String(input).toLowerCase();
|
|
1066
1065
|
if (/^\d+$/.test(inputStr)) {
|
|
1067
1066
|
const heroId = Number(inputStr);
|
|
1068
|
-
if (this.dotaconstants.heroes[heroId]) {
|
|
1067
|
+
if (this.ctx.dota2tracker.dotaconstants.heroes[heroId]) {
|
|
1069
1068
|
return heroId;
|
|
1070
1069
|
}
|
|
1071
1070
|
}
|
|
@@ -1099,13 +1098,12 @@ var RANK_BRACKETS = ["UNCALIBRATED", "HERALD", "GUARDIAN", "CRUSADER", "ARCHON",
|
|
|
1099
1098
|
|
|
1100
1099
|
// src/app/core/hero.service.ts
|
|
1101
1100
|
var HeroService = class _HeroService extends import_koishi2.Service {
|
|
1102
|
-
constructor(ctx, dotaconstants) {
|
|
1103
|
-
super(ctx, "dota2tracker.hero", true);
|
|
1104
|
-
this.dotaconstants = dotaconstants;
|
|
1105
|
-
}
|
|
1106
1101
|
static {
|
|
1107
1102
|
__name(this, "HeroService");
|
|
1108
1103
|
}
|
|
1104
|
+
constructor(ctx) {
|
|
1105
|
+
super(ctx, "dota2tracker.hero", true);
|
|
1106
|
+
}
|
|
1109
1107
|
async getWeeklyHeroMeta(rank) {
|
|
1110
1108
|
const MINIMUM_PICK_RATE = 0.02;
|
|
1111
1109
|
const RECOMMENDATION_COUNT = 3;
|
|
@@ -1140,7 +1138,7 @@ var HeroService = class _HeroService extends import_koishi2.Service {
|
|
|
1140
1138
|
return weeklyHeroMeta;
|
|
1141
1139
|
}
|
|
1142
1140
|
async getHeroDetails(input, languageTag, isRandom = false) {
|
|
1143
|
-
const heroId = this.ctx.dota2tracker.i18n.findHeroIdInLocale(isRandom ? import_koishi2.Random.pick(Object.keys(this.dotaconstants.heroes)) : input);
|
|
1141
|
+
const heroId = this.ctx.dota2tracker.i18n.findHeroIdInLocale(isRandom ? import_koishi2.Random.pick(Object.keys(this.ctx.dota2tracker.dotaconstants.heroes)) : input);
|
|
1144
1142
|
if (!heroId) return;
|
|
1145
1143
|
return _HeroService.formatHeroDetails(await this.ctx.dota2tracker.valveAPI.queryHeroDetailsFromValve(heroId, languageTag));
|
|
1146
1144
|
}
|
|
@@ -1505,7 +1503,7 @@ function handleError(error, logger, i18n, config) {
|
|
|
1505
1503
|
`;
|
|
1506
1504
|
}
|
|
1507
1505
|
output += error.stack;
|
|
1508
|
-
const logLevel = config.suppressApiNetworkErrors
|
|
1506
|
+
const logLevel = config.suppressApiNetworkErrors ? "debug" : "error";
|
|
1509
1507
|
logger[logLevel](output);
|
|
1510
1508
|
} else {
|
|
1511
1509
|
let output = "An unexpected error was thrown:\n";
|
|
@@ -1521,10 +1519,9 @@ __name(handleError, "handleError");
|
|
|
1521
1519
|
|
|
1522
1520
|
// src/app/core/match.service.ts
|
|
1523
1521
|
var MatchService = class _MatchService extends import_koishi4.Service {
|
|
1524
|
-
constructor(ctx, pluginVersion
|
|
1522
|
+
constructor(ctx, pluginVersion) {
|
|
1525
1523
|
super(ctx, "dota2tracker.match", true);
|
|
1526
1524
|
this.pluginVersion = pluginVersion;
|
|
1527
|
-
this.dotaconstants = dotaconstants;
|
|
1528
1525
|
}
|
|
1529
1526
|
static {
|
|
1530
1527
|
__name(this, "MatchService");
|
|
@@ -1629,7 +1626,7 @@ var MatchService = class _MatchService extends import_koishi4.Service {
|
|
|
1629
1626
|
}
|
|
1630
1627
|
const facetData = await _MatchService.constantsInjectFacetData(constantsQuery, matchQuery, languageTag, this.ctx.dota2tracker.hero);
|
|
1631
1628
|
this.ctx.dota2tracker.cache.setFacetConstantsCache(languageTag, constantsQuery);
|
|
1632
|
-
const match = _MatchService.extendMatchData(matchQuery, facetData, this.dotaconstants);
|
|
1629
|
+
const match = _MatchService.extendMatchData(matchQuery, facetData, this.ctx.dota2tracker.dotaconstants);
|
|
1633
1630
|
return match;
|
|
1634
1631
|
} catch (error) {
|
|
1635
1632
|
this.ctx.dota2tracker.cache.deleteFacetConstantsCache(languageTag);
|
|
@@ -1923,14 +1920,13 @@ __name(createItemObject, "createItemObject");
|
|
|
1923
1920
|
var import_koishi5 = require("koishi");
|
|
1924
1921
|
var import_luxon3 = require("luxon");
|
|
1925
1922
|
var PlayerService = class _PlayerService extends import_koishi5.Service {
|
|
1926
|
-
constructor(ctx, dotaconstants) {
|
|
1927
|
-
super(ctx, "dota2tracker.player", true);
|
|
1928
|
-
this.dotaconstants = dotaconstants;
|
|
1929
|
-
this.config = ctx.config;
|
|
1930
|
-
}
|
|
1931
1923
|
static {
|
|
1932
1924
|
__name(this, "PlayerService");
|
|
1933
1925
|
}
|
|
1926
|
+
constructor(ctx) {
|
|
1927
|
+
super(ctx, "dota2tracker.player", true);
|
|
1928
|
+
this.config = ctx.config;
|
|
1929
|
+
}
|
|
1934
1930
|
async getHeroRecommendation(steamId, player) {
|
|
1935
1931
|
const RECENT_IMP_WEIGHT = 0.1;
|
|
1936
1932
|
const LIFETIME_WIN_LOG_WEIGHT = 5;
|
|
@@ -2058,7 +2054,7 @@ var PlayerService = class _PlayerService extends import_koishi5.Service {
|
|
|
2058
2054
|
genHero: heroId ? { heroId, name: this.ctx.dota2tracker.i18n.getConstantLocale(languageTag).dota2tracker.template.hero_names[heroId] } : null,
|
|
2059
2055
|
estimateRank: this.config.playerRankEstimate
|
|
2060
2056
|
},
|
|
2061
|
-
this.dotaconstants
|
|
2057
|
+
this.ctx.dota2tracker.dotaconstants
|
|
2062
2058
|
);
|
|
2063
2059
|
return player;
|
|
2064
2060
|
}
|
|
@@ -2236,7 +2232,6 @@ var CacheService = class extends import_koishi6.Service {
|
|
|
2236
2232
|
}
|
|
2237
2233
|
addOpendotaAPIRequestLog(request, count = 1) {
|
|
2238
2234
|
this.ctx.cache.set("dt_opendota_api_request_log", String(Date.now()), { count, request }, this.msUntilUTCEndOfDay);
|
|
2239
|
-
if (this.config.enableConsole) this.ctx.console.services["apiCount"].refresh();
|
|
2240
2235
|
}
|
|
2241
2236
|
async getTodayOpendotaAPIRequestCount() {
|
|
2242
2237
|
let count = 0;
|
|
@@ -2552,11 +2547,11 @@ var MiniQueue = class {
|
|
|
2552
2547
|
if (this.stopped) {
|
|
2553
2548
|
return Promise.reject(new Error("Queue has been disposed."));
|
|
2554
2549
|
}
|
|
2555
|
-
return new Promise((
|
|
2550
|
+
return new Promise((resolve, reject) => {
|
|
2556
2551
|
this.queue.push(async () => {
|
|
2557
2552
|
try {
|
|
2558
2553
|
const result = await task();
|
|
2559
|
-
|
|
2554
|
+
resolve(result);
|
|
2560
2555
|
} catch (error) {
|
|
2561
2556
|
reject(error);
|
|
2562
2557
|
}
|
|
@@ -2577,7 +2572,7 @@ var MiniQueue = class {
|
|
|
2577
2572
|
const task = this.queue.shift();
|
|
2578
2573
|
if (task) {
|
|
2579
2574
|
await task();
|
|
2580
|
-
await new Promise((
|
|
2575
|
+
await new Promise((resolve) => this.ctx.setTimeout(resolve, this.interval));
|
|
2581
2576
|
}
|
|
2582
2577
|
this.isProcessing = false;
|
|
2583
2578
|
this._process();
|
|
@@ -2671,16 +2666,15 @@ var ImageFormat = /* @__PURE__ */ ((ImageFormat2) => {
|
|
|
2671
2666
|
// src/app/presentation/image.renderer.ts
|
|
2672
2667
|
var import_luxon5 = require("luxon");
|
|
2673
2668
|
var ImageRenderer = class extends import_koishi10.Service {
|
|
2674
|
-
constructor(ctx, currentDir, dotaconstants) {
|
|
2675
|
-
super(ctx, "dota2tracker.image", true);
|
|
2676
|
-
this.dotaconstants = dotaconstants;
|
|
2677
|
-
this.config = ctx.config;
|
|
2678
|
-
this.templateDir = import_path2.default.join(currentDir, "templates");
|
|
2679
|
-
}
|
|
2680
2669
|
static {
|
|
2681
2670
|
__name(this, "ImageRenderer");
|
|
2682
2671
|
}
|
|
2683
2672
|
templateDir;
|
|
2673
|
+
constructor(ctx, currentDir) {
|
|
2674
|
+
super(ctx, "dota2tracker.image", true);
|
|
2675
|
+
this.config = ctx.config;
|
|
2676
|
+
this.templateDir = import_path2.default.join(currentDir, "templates");
|
|
2677
|
+
}
|
|
2684
2678
|
async renderToImageByFile(data, templateName, type, languageTag) {
|
|
2685
2679
|
const html = await this.generateHTML(data, { source: "FILE", templateName, type }, languageTag);
|
|
2686
2680
|
return this.ctx.puppeteer.render(html);
|
|
@@ -2697,7 +2691,7 @@ var ImageRenderer = class extends import_koishi10.Service {
|
|
|
2697
2691
|
data,
|
|
2698
2692
|
ImageType,
|
|
2699
2693
|
ImageFormat,
|
|
2700
|
-
dotaconstants: this.dotaconstants,
|
|
2694
|
+
dotaconstants: this.ctx.dota2tracker.dotaconstants,
|
|
2701
2695
|
DateTime: import_luxon5.DateTime,
|
|
2702
2696
|
$t: /* @__PURE__ */ __name((key, params) => this.ctx.dota2tracker.i18n.$t(languageTag, key, params), "$t"),
|
|
2703
2697
|
languageTag,
|
|
@@ -3459,13 +3453,58 @@ async function resolvePlayerAndHandleErrors(ctx, session, input) {
|
|
|
3459
3453
|
return Number(result.steamId);
|
|
3460
3454
|
}
|
|
3461
3455
|
__name(resolvePlayerAndHandleErrors, "resolvePlayerAndHandleErrors");
|
|
3456
|
+
var TaskMessenger = class {
|
|
3457
|
+
constructor(session, options = { autoRecall: true }) {
|
|
3458
|
+
this.session = session;
|
|
3459
|
+
this.options = options;
|
|
3460
|
+
}
|
|
3461
|
+
static {
|
|
3462
|
+
__name(this, "TaskMessenger");
|
|
3463
|
+
}
|
|
3464
|
+
tipIds = [];
|
|
3465
|
+
/**
|
|
3466
|
+
* 发送一条提示消息,并记录其 ID 以便后续撤回
|
|
3467
|
+
* @param content 提示内容
|
|
3468
|
+
* @returns 返回 this 实例,支持链式调用
|
|
3469
|
+
*/
|
|
3470
|
+
async send(content) {
|
|
3471
|
+
try {
|
|
3472
|
+
const result = await this.session.send(content);
|
|
3473
|
+
const newIds = Array.isArray(result) ? result : [result];
|
|
3474
|
+
this.tipIds.push(...newIds);
|
|
3475
|
+
} catch (e) {
|
|
3476
|
+
}
|
|
3477
|
+
return this;
|
|
3478
|
+
}
|
|
3479
|
+
/**
|
|
3480
|
+
* 任务结束,撤回所有提示消息
|
|
3481
|
+
*/
|
|
3482
|
+
async finish() {
|
|
3483
|
+
if (!this.options.autoRecall) {
|
|
3484
|
+
this.tipIds = [];
|
|
3485
|
+
return;
|
|
3486
|
+
}
|
|
3487
|
+
if (this.tipIds.length === 0) return;
|
|
3488
|
+
const idsToRecall = [...this.tipIds].reverse();
|
|
3489
|
+
this.tipIds = [];
|
|
3490
|
+
for (const id of idsToRecall) {
|
|
3491
|
+
try {
|
|
3492
|
+
await this.session.bot.deleteMessage(this.session.channelId, id);
|
|
3493
|
+
} catch (e) {
|
|
3494
|
+
}
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
};
|
|
3462
3498
|
|
|
3463
3499
|
// src/app/commands/hero-of-the-day.command.ts
|
|
3464
3500
|
var import_luxon10 = require("luxon");
|
|
3465
3501
|
function registerHeroOfTheDayCommand(ctx) {
|
|
3466
3502
|
const name2 = "hero-of-the-day";
|
|
3503
|
+
const logger = ctx.logger("command/" + name2);
|
|
3467
3504
|
ctx.command(`dota2tracker.${name2} <input_data>`).alias("今日英雄").option("days", "-d <value:number>").action(async ({ session, options }, input_data) => {
|
|
3505
|
+
const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
|
|
3468
3506
|
try {
|
|
3507
|
+
await task.send(session.text(".querying"));
|
|
3469
3508
|
const steamId = await resolvePlayerAndHandleErrors(ctx, session, input_data);
|
|
3470
3509
|
if (steamId === null) return;
|
|
3471
3510
|
const days = clamp(options.days, 1, 180, 30);
|
|
@@ -3477,10 +3516,13 @@ function registerHeroOfTheDayCommand(ctx) {
|
|
|
3477
3516
|
const metaPromise = ctx.dota2tracker.hero.getWeeklyHeroMeta(PlayerService.estimateWeightedRank(result.player));
|
|
3478
3517
|
const [recommendation, weeklyHeroMeta] = await Promise.all([recommendationPromise, metaPromise]);
|
|
3479
3518
|
const languageTag = await ctx.dota2tracker.i18n.getLanguageTag({ session });
|
|
3519
|
+
await task.finish();
|
|
3480
3520
|
const message = ctx.dota2tracker.messageBuilder.buildHeroOfTheDayMessage(languageTag, recommendation, weeklyHeroMeta);
|
|
3481
3521
|
return message;
|
|
3482
3522
|
} catch (error) {
|
|
3483
|
-
|
|
3523
|
+
await task.finish();
|
|
3524
|
+
handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
|
|
3525
|
+
return session.text(".query_failed");
|
|
3484
3526
|
}
|
|
3485
3527
|
});
|
|
3486
3528
|
}
|
|
@@ -3488,20 +3530,28 @@ __name(registerHeroOfTheDayCommand, "registerHeroOfTheDayCommand");
|
|
|
3488
3530
|
|
|
3489
3531
|
// src/app/commands/query-hero.command.ts
|
|
3490
3532
|
function registerQueryHeroCommand(ctx) {
|
|
3491
|
-
|
|
3492
|
-
|
|
3533
|
+
const name2 = "query-hero";
|
|
3534
|
+
const logger = ctx.logger("command/" + name2);
|
|
3535
|
+
ctx.command(`dota2tracker.${name2} <input_data>`).option("random", "-r").alias("查询英雄").action(async ({ session, options }, input_data) => {
|
|
3536
|
+
const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
|
|
3493
3537
|
try {
|
|
3494
3538
|
if (input_data || options.random) {
|
|
3495
|
-
await
|
|
3539
|
+
await task.send(session.text(".querying_hero"));
|
|
3496
3540
|
const languageTag = await ctx.dota2tracker.i18n.getLanguageTag({ session });
|
|
3497
3541
|
const heroData = await ctx.dota2tracker.hero.getHeroDetails(input_data, languageTag, options.random);
|
|
3498
|
-
if (!heroData)
|
|
3542
|
+
if (!heroData) {
|
|
3543
|
+
await task.finish();
|
|
3544
|
+
return session.text(".not_found");
|
|
3545
|
+
}
|
|
3499
3546
|
const image = await ctx.dota2tracker.image.renderToImageByFile(heroData, ctx.config.template_hero, "hero" /* Hero */, languageTag);
|
|
3500
3547
|
const message = ctx.dota2tracker.messageBuilder.buildHeroMessage(heroData);
|
|
3548
|
+
await task.finish();
|
|
3501
3549
|
await session.send(message + image);
|
|
3502
3550
|
}
|
|
3503
3551
|
} catch (error) {
|
|
3504
|
-
|
|
3552
|
+
await task.finish();
|
|
3553
|
+
handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
|
|
3554
|
+
return session.text(".query_failed");
|
|
3505
3555
|
}
|
|
3506
3556
|
});
|
|
3507
3557
|
}
|
|
@@ -3509,46 +3559,56 @@ __name(registerQueryHeroCommand, "registerQueryHeroCommand");
|
|
|
3509
3559
|
|
|
3510
3560
|
// src/app/commands/query-item.command.ts
|
|
3511
3561
|
function registerQueryItemCommand(ctx) {
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
const image = await ctx.dota2tracker.image.renderToImageByFile(allItems, "itemlist", "item" /* Item */, languageTag2);
|
|
3519
|
-
await session.send(image);
|
|
3520
|
-
} else {
|
|
3521
|
-
await session.send(session.text(".empty_input"));
|
|
3522
|
-
}
|
|
3562
|
+
const name2 = "query-item";
|
|
3563
|
+
const logger = ctx.logger("command/" + name2);
|
|
3564
|
+
ctx.command(`dota2tracker.${name2} <input_data>`).alias("查询物品").action(async ({ session }, input_data) => {
|
|
3565
|
+
const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
|
|
3566
|
+
if (!input_data && !ctx.config.showItemListAtTooMuchItems) {
|
|
3567
|
+
await session.send(session.text(".empty_input"));
|
|
3523
3568
|
return;
|
|
3524
3569
|
}
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
}
|
|
3533
|
-
if (matchedItemList.length > ctx.config.maxSendItemCount) {
|
|
3534
|
-
await session.send(session.text(".too_many_items", { count: matchedItemList.length, max: ctx.config.maxSendItemCount }));
|
|
3535
|
-
if (ctx.config.showItemListAtTooMuchItems) {
|
|
3536
|
-
const image = await ctx.dota2tracker.image.renderToImageByFile(matchedItemList, "itemlist", "item" /* Item */, languageTag);
|
|
3570
|
+
try {
|
|
3571
|
+
await task.send(session.text(".querying_item"));
|
|
3572
|
+
const languageTag = await ctx.dota2tracker.i18n.getLanguageTag({ session });
|
|
3573
|
+
const itemList = await ctx.dota2tracker.item.getItemList({ languageTag, onCacheMissTip: /* @__PURE__ */ __name(() => task.send(session.text(".cache_building")), "onCacheMissTip") });
|
|
3574
|
+
if (!input_data) {
|
|
3575
|
+
const image = await ctx.dota2tracker.image.renderToImageByFile(itemList, "itemlist", "item" /* Item */, languageTag);
|
|
3576
|
+
await task.finish();
|
|
3537
3577
|
await session.send(image);
|
|
3578
|
+
return;
|
|
3538
3579
|
}
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
await session.send(
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3580
|
+
const matchedItemList = ctx.dota2tracker.item.searchItems(itemList, input_data, languageTag, ctx.config);
|
|
3581
|
+
if (matchedItemList.length === 0) {
|
|
3582
|
+
await task.finish();
|
|
3583
|
+
await session.send(session.text(".not_found"));
|
|
3584
|
+
return;
|
|
3585
|
+
}
|
|
3586
|
+
if (matchedItemList.length > ctx.config.maxSendItemCount) {
|
|
3587
|
+
await task.finish();
|
|
3588
|
+
await session.send(session.text(".too_many_items", { count: matchedItemList.length, max: ctx.config.maxSendItemCount }));
|
|
3589
|
+
if (ctx.config.showItemListAtTooMuchItems) {
|
|
3590
|
+
const image = await ctx.dota2tracker.image.renderToImageByFile(matchedItemList, "itemlist", "item" /* Item */, languageTag);
|
|
3591
|
+
await session.send(image);
|
|
3592
|
+
}
|
|
3593
|
+
return;
|
|
3594
|
+
}
|
|
3595
|
+
await task.finish();
|
|
3596
|
+
await session.send(session.text(".finded_items", { items: matchedItemList }));
|
|
3597
|
+
for (const basicItemInfo of matchedItemList) {
|
|
3598
|
+
try {
|
|
3599
|
+
const itemDetails = await ctx.dota2tracker.item.getItemDetails(basicItemInfo.id, languageTag);
|
|
3600
|
+
const finalItemData = { ...itemDetails, ...basicItemInfo };
|
|
3601
|
+
const image = await ctx.dota2tracker.image.renderToImageByFile(finalItemData, "item", "item" /* Item */, languageTag);
|
|
3602
|
+
await session.send(image);
|
|
3603
|
+
} catch (error) {
|
|
3604
|
+
ctx.logger.error(`查询物品[${basicItemInfo.name_loc}]详情失败:`, error);
|
|
3605
|
+
await session.send(session.text(".query_item_failed", { name: basicItemInfo.name_loc }));
|
|
3606
|
+
}
|
|
3551
3607
|
}
|
|
3608
|
+
} catch (error) {
|
|
3609
|
+
await task.finish();
|
|
3610
|
+
handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
|
|
3611
|
+
return session.text(".query_list_failed");
|
|
3552
3612
|
}
|
|
3553
3613
|
});
|
|
3554
3614
|
}
|
|
@@ -3558,32 +3618,45 @@ __name(registerQueryItemCommand, "registerQueryItemCommand");
|
|
|
3558
3618
|
function registerQueryMatchCommand(ctx) {
|
|
3559
3619
|
ctx.command("dota2tracker.query-match <match_id>").alias("查询比赛").option("parse", "-p").option("template", "-t <value:string>").action(async ({ session, options }, match_id) => {
|
|
3560
3620
|
const name2 = "query-match";
|
|
3621
|
+
const logger = ctx.logger("command/" + name2);
|
|
3622
|
+
const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
|
|
3561
3623
|
try {
|
|
3562
3624
|
if (!match_id) return session.text(".empty_input");
|
|
3563
3625
|
if (!/^\d{1,11}$/.test(match_id)) return session.text(".match_id_invalid");
|
|
3564
|
-
await
|
|
3565
|
-
|
|
3626
|
+
await task.send(session.text(".querying_match"));
|
|
3627
|
+
const message = await handleQueryMatchCommand(ctx, ctx.config, session, options, match_id);
|
|
3628
|
+
await task.finish();
|
|
3629
|
+
return message;
|
|
3566
3630
|
} catch (error) {
|
|
3567
|
-
|
|
3631
|
+
await task.finish();
|
|
3632
|
+
handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
|
|
3633
|
+
return session.text(".query_failed");
|
|
3568
3634
|
}
|
|
3569
3635
|
});
|
|
3570
3636
|
ctx.command("dota2tracker.query-recent-match [input_data]").alias("查询最近比赛").option("parse", "-p").option("template", "-t <value:string>").action(async ({ session, options }, input_data) => {
|
|
3571
3637
|
const name2 = "query-recent-match";
|
|
3638
|
+
const logger = ctx.logger("command/" + name2);
|
|
3639
|
+
const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
|
|
3572
3640
|
try {
|
|
3573
3641
|
const steamId = await resolvePlayerAndHandleErrors(ctx, session, input_data);
|
|
3574
3642
|
if (steamId === null) return;
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3643
|
+
await task.send(session.text(".querying_match"));
|
|
3644
|
+
const lastMatch = await ctx.dota2tracker.player.getLastMatchId(Number(steamId));
|
|
3645
|
+
if (!lastMatch?.id) {
|
|
3646
|
+
await task.finish();
|
|
3647
|
+
return session.text(".query_failed");
|
|
3648
|
+
}
|
|
3649
|
+
if (lastMatch.isAnonymous) {
|
|
3650
|
+
await task.finish();
|
|
3651
|
+
return session.text(".is_anonymous");
|
|
3581
3652
|
}
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
return
|
|
3653
|
+
const message = await handleQueryMatchCommand(ctx, ctx.config, session, options, lastMatch.id);
|
|
3654
|
+
await task.finish();
|
|
3655
|
+
return message;
|
|
3585
3656
|
} catch (error) {
|
|
3586
|
-
|
|
3657
|
+
await task.finish();
|
|
3658
|
+
handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
|
|
3659
|
+
return session.text(".query_failed");
|
|
3587
3660
|
}
|
|
3588
3661
|
});
|
|
3589
3662
|
}
|
|
@@ -3620,24 +3693,29 @@ __name(registerQueryMembersCommand, "registerQueryMembersCommand");
|
|
|
3620
3693
|
|
|
3621
3694
|
// src/app/commands/query-player.command.ts
|
|
3622
3695
|
function registerQueryPlayerCommand(ctx) {
|
|
3696
|
+
const name2 = "query-player";
|
|
3697
|
+
const logger = ctx.logger("command/" + name2);
|
|
3623
3698
|
ctx.command("dota2tracker.query-player <input_data>").option("hero", "-o <value:string>").alias("查询玩家").action(async ({ session, options }, input_data) => {
|
|
3624
|
-
const
|
|
3699
|
+
const task = new TaskMessenger(session, { autoRecall: ctx.config.autoRecallTips });
|
|
3625
3700
|
try {
|
|
3626
3701
|
if (session.guild || !session.guild && input_data) {
|
|
3627
3702
|
const steamId = await resolvePlayerAndHandleErrors(ctx, session, input_data);
|
|
3628
3703
|
if (steamId === null) return;
|
|
3629
|
-
|
|
3704
|
+
await task.send(session.text(".querying_player"));
|
|
3630
3705
|
const heroId = ctx.dota2tracker.i18n.findHeroIdInLocale(options.hero);
|
|
3631
3706
|
const languageTag = await ctx.dota2tracker.i18n.getLanguageTag({ session });
|
|
3632
3707
|
const formattedPlayerData = await ctx.dota2tracker.player.getFormattedPlayerData(steamId, heroId, languageTag);
|
|
3633
3708
|
const image = await ctx.dota2tracker.image.renderToImageByFile(formattedPlayerData, ctx.config.template_player, "player" /* Player */, languageTag);
|
|
3634
3709
|
const message = ctx.dota2tracker.messageBuilder.buildPlayerMessage(steamId);
|
|
3710
|
+
await task.finish();
|
|
3635
3711
|
return message + image;
|
|
3636
3712
|
} else {
|
|
3637
3713
|
return session.text("commands.dota2tracker.common.messages.user_not_in_group");
|
|
3638
3714
|
}
|
|
3639
3715
|
} catch (error) {
|
|
3640
|
-
|
|
3716
|
+
await task.finish();
|
|
3717
|
+
handleError(error, logger, ctx.dota2tracker.i18n, ctx.config);
|
|
3718
|
+
return session.text(".query_failed");
|
|
3641
3719
|
}
|
|
3642
3720
|
});
|
|
3643
3721
|
}
|
|
@@ -3773,13 +3851,12 @@ var OpenDotaAPI = class extends import_koishi15.Service {
|
|
|
3773
3851
|
// src/app/core/opendota.adapter.ts
|
|
3774
3852
|
var import_koishi16 = require("koishi");
|
|
3775
3853
|
var OpenDotaAdapter = class extends import_koishi16.Service {
|
|
3776
|
-
constructor(ctx, dotaconstants) {
|
|
3777
|
-
super(ctx, "dota2tracker.opendota-adapter", true);
|
|
3778
|
-
this.dotaconstants = dotaconstants;
|
|
3779
|
-
}
|
|
3780
3854
|
static {
|
|
3781
3855
|
__name(this, "OpenDotaAdapter");
|
|
3782
3856
|
}
|
|
3857
|
+
constructor(ctx) {
|
|
3858
|
+
super(ctx, "dota2tracker.opendota-adapter", true);
|
|
3859
|
+
}
|
|
3783
3860
|
transform(_match) {
|
|
3784
3861
|
determinePlayerPositions(_match);
|
|
3785
3862
|
const players = [];
|
|
@@ -3827,9 +3904,9 @@ var OpenDotaAdapter = class extends import_koishi16.Service {
|
|
|
3827
3904
|
steamAccount: { name: _player.personaname, seasonRank: _player.rank_tier, seasonLeaderboardRank: null },
|
|
3828
3905
|
hero: {
|
|
3829
3906
|
id: _player.hero_id,
|
|
3830
|
-
name: this.dotaconstants.heroes[_player.hero_id].name,
|
|
3831
|
-
shortName: this.dotaconstants.heroes[_player.hero_id].name.match(/^npc_dota_hero_(.+)$/)[1],
|
|
3832
|
-
facets: [...this.dotaconstants.hero_abilities[this.dotaconstants.heroes[_player.hero_id].name].facets.map((f) => ({ id: -1, name: f.name }))]
|
|
3907
|
+
name: this.ctx.dota2tracker.dotaconstants.heroes[_player.hero_id].name,
|
|
3908
|
+
shortName: this.ctx.dota2tracker.dotaconstants.heroes[_player.hero_id].name.match(/^npc_dota_hero_(.+)$/)[1],
|
|
3909
|
+
facets: [...this.ctx.dota2tracker.dotaconstants.hero_abilities[this.ctx.dota2tracker.dotaconstants.heroes[_player.hero_id].name].facets.map((f) => ({ id: -1, name: f.name }))]
|
|
3833
3910
|
},
|
|
3834
3911
|
dotaPlus: null,
|
|
3835
3912
|
stats: {
|
|
@@ -3860,7 +3937,7 @@ var OpenDotaAdapter = class extends import_koishi16.Service {
|
|
|
3860
3937
|
disableCount: 0
|
|
3861
3938
|
}
|
|
3862
3939
|
},
|
|
3863
|
-
itemPurchases: _player.purchase_log.map((p) => ({ time: p.time, itemId: this.dotaconstants.items[p.key].id }))
|
|
3940
|
+
itemPurchases: _player.purchase_log.map((p) => ({ time: p.time, itemId: this.ctx.dota2tracker.dotaconstants.items[p.key].id }))
|
|
3864
3941
|
},
|
|
3865
3942
|
additionalUnit: null
|
|
3866
3943
|
};
|
|
@@ -3889,8 +3966,8 @@ var OpenDotaAdapter = class extends import_koishi16.Service {
|
|
|
3889
3966
|
const match = {
|
|
3890
3967
|
id: _match.match_id,
|
|
3891
3968
|
didRadiantWin: _match.radiant_win,
|
|
3892
|
-
lobbyType: convertLobbyType(_match.lobby_type, this.dotaconstants),
|
|
3893
|
-
gameMode: convertGameMode(_match.game_mode, this.dotaconstants),
|
|
3969
|
+
lobbyType: convertLobbyType(_match.lobby_type, this.ctx.dota2tracker.dotaconstants),
|
|
3970
|
+
gameMode: convertGameMode(_match.game_mode, this.ctx.dota2tracker.dotaconstants),
|
|
3894
3971
|
regionId: _match.region,
|
|
3895
3972
|
parsedDateTime: _match.start_time + _match.duration,
|
|
3896
3973
|
startDateTime: _match.start_time,
|
|
@@ -3913,6 +3990,13 @@ var OpenDotaAdapter = class extends import_koishi16.Service {
|
|
|
3913
3990
|
radiantExperienceLeads: [0, ..._match.radiant_xp_adv],
|
|
3914
3991
|
// opendota两组数据都需要补充-1分钟时的数据对齐stratz格式。
|
|
3915
3992
|
winRates: null,
|
|
3993
|
+
towerStatusRadiant: _match.tower_status_radiant,
|
|
3994
|
+
towerStatusDire: _match.tower_status_dire,
|
|
3995
|
+
barracksStatusRadiant: _match.barracks_status_radiant,
|
|
3996
|
+
barracksStatusDire: _match.barracks_status_dire,
|
|
3997
|
+
playbackData: {
|
|
3998
|
+
buildingEvents: convertBuildingEvents(_match.objectives)
|
|
3999
|
+
},
|
|
3916
4000
|
players,
|
|
3917
4001
|
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 })),
|
|
3918
4002
|
odParsed: true
|
|
@@ -4166,46 +4250,65 @@ function determineIMP(player) {
|
|
|
4166
4250
|
return Math.round(totalScore / values.length * 100 - 50);
|
|
4167
4251
|
}
|
|
4168
4252
|
__name(determineIMP, "determineIMP");
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4253
|
+
function convertBuildingEvents(objectives) {
|
|
4254
|
+
if (!objectives) return [];
|
|
4255
|
+
const KEY_TO_ID = {
|
|
4256
|
+
// ================= 天辉 Radiant =================
|
|
4257
|
+
npc_dota_goodguys_tower1_top: 16,
|
|
4258
|
+
npc_dota_goodguys_tower2_top: 19,
|
|
4259
|
+
npc_dota_goodguys_tower3_top: 22,
|
|
4260
|
+
npc_dota_goodguys_tower1_mid: 17,
|
|
4261
|
+
npc_dota_goodguys_tower2_mid: 20,
|
|
4262
|
+
npc_dota_goodguys_tower3_mid: 23,
|
|
4263
|
+
npc_dota_goodguys_tower1_bot: 18,
|
|
4264
|
+
npc_dota_goodguys_tower2_bot: 21,
|
|
4265
|
+
npc_dota_goodguys_tower3_bot: 24,
|
|
4266
|
+
npc_dota_goodguys_tower4: 25,
|
|
4267
|
+
// 统一映射 T4
|
|
4268
|
+
npc_dota_goodguys_melee_rax_top: 38,
|
|
4269
|
+
npc_dota_goodguys_range_rax_top: 41,
|
|
4270
|
+
npc_dota_goodguys_melee_rax_mid: 39,
|
|
4271
|
+
npc_dota_goodguys_range_rax_mid: 42,
|
|
4272
|
+
npc_dota_goodguys_melee_rax_bot: 40,
|
|
4273
|
+
npc_dota_goodguys_range_rax_bot: 43,
|
|
4274
|
+
npc_dota_goodguys_fort: 50,
|
|
4275
|
+
// ================= 夜魇 Dire =================
|
|
4276
|
+
npc_dota_badguys_tower1_top: 26,
|
|
4277
|
+
npc_dota_badguys_tower2_top: 29,
|
|
4278
|
+
npc_dota_badguys_tower3_top: 32,
|
|
4279
|
+
npc_dota_badguys_tower1_mid: 27,
|
|
4280
|
+
npc_dota_badguys_tower2_mid: 30,
|
|
4281
|
+
npc_dota_badguys_tower3_mid: 33,
|
|
4282
|
+
npc_dota_badguys_tower1_bot: 28,
|
|
4283
|
+
npc_dota_badguys_tower2_bot: 31,
|
|
4284
|
+
npc_dota_badguys_tower3_bot: 34,
|
|
4285
|
+
npc_dota_badguys_tower4: 35,
|
|
4286
|
+
// 统一映射 T4
|
|
4287
|
+
npc_dota_badguys_melee_rax_top: 44,
|
|
4288
|
+
npc_dota_badguys_range_rax_top: 47,
|
|
4289
|
+
npc_dota_badguys_melee_rax_mid: 45,
|
|
4290
|
+
npc_dota_badguys_range_rax_mid: 48,
|
|
4291
|
+
npc_dota_badguys_melee_rax_bot: 46,
|
|
4292
|
+
npc_dota_badguys_range_rax_bot: 49,
|
|
4293
|
+
npc_dota_badguys_fort: 51
|
|
4294
|
+
};
|
|
4295
|
+
const events = [];
|
|
4296
|
+
for (const obj of objectives) {
|
|
4297
|
+
if (obj.type === "building_kill" && obj.key && KEY_TO_ID[obj.key]) {
|
|
4298
|
+
events.push({
|
|
4299
|
+
time: obj.time,
|
|
4300
|
+
npcId: KEY_TO_ID[obj.key]
|
|
4301
|
+
});
|
|
4302
|
+
}
|
|
4187
4303
|
}
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
// src/console.ts
|
|
4191
|
-
function registerConsolePage(ctx) {
|
|
4192
|
-
const tracker = ctx.dota2tracker;
|
|
4193
|
-
if (!tracker) {
|
|
4194
|
-
ctx.logger("dota2tracker").warn("dota2tracker service is missing during console registration!");
|
|
4195
|
-
return;
|
|
4196
|
-
}
|
|
4197
|
-
new CustomProvider(ctx, tracker);
|
|
4198
|
-
ctx.console.addEntry({
|
|
4199
|
-
dev: (0, import_path3.resolve)(__dirname, "../client/index.ts"),
|
|
4200
|
-
prod: (0, import_path3.resolve)(__dirname, "../dist")
|
|
4201
|
-
});
|
|
4304
|
+
return events;
|
|
4202
4305
|
}
|
|
4203
|
-
__name(
|
|
4306
|
+
__name(convertBuildingEvents, "convertBuildingEvents");
|
|
4204
4307
|
|
|
4205
4308
|
// src/config.ts
|
|
4206
4309
|
var import_koishi17 = require("koishi");
|
|
4207
4310
|
var import_fs3 = __toESM(require("fs"));
|
|
4208
|
-
var
|
|
4311
|
+
var import_path3 = __toESM(require("path"));
|
|
4209
4312
|
|
|
4210
4313
|
// require("./locales/**/*.schema.yml") in src/config.ts
|
|
4211
4314
|
var globRequire_locales_schema_yml = __glob({
|
|
@@ -4214,7 +4317,7 @@ var globRequire_locales_schema_yml = __glob({
|
|
|
4214
4317
|
});
|
|
4215
4318
|
|
|
4216
4319
|
// src/config.ts
|
|
4217
|
-
var templateDir =
|
|
4320
|
+
var templateDir = import_path3.default.join(__dirname, "templates");
|
|
4218
4321
|
var allI18nConfigs = Object.fromEntries(Object.keys(LanguageTags).map((lang) => [lang, globRequire_locales_schema_yml(`./locales/${lang}.schema.yml`)._config]));
|
|
4219
4322
|
var Config = import_koishi17.Schema.intersect([
|
|
4220
4323
|
import_koishi17.Schema.intersect([
|
|
@@ -4222,10 +4325,8 @@ var Config = import_koishi17.Schema.intersect([
|
|
|
4222
4325
|
STRATZ_API_TOKEN: import_koishi17.Schema.string().required().role("secret"),
|
|
4223
4326
|
dataParsingTimeoutMinutes: import_koishi17.Schema.number().default(60).min(0).max(1440),
|
|
4224
4327
|
proxyAddress: import_koishi17.Schema.string(),
|
|
4225
|
-
suppressStratzNetworkErrors: import_koishi17.Schema.boolean().default(false).deprecated(),
|
|
4226
4328
|
suppressApiNetworkErrors: import_koishi17.Schema.boolean().default(false),
|
|
4227
|
-
enableOpenDotaFallback: import_koishi17.Schema.boolean().default(false)
|
|
4228
|
-
enableConsole: import_koishi17.Schema.boolean().default(false).experimental()
|
|
4329
|
+
enableOpenDotaFallback: import_koishi17.Schema.boolean().default(false)
|
|
4229
4330
|
}).i18n(getI18n("base")),
|
|
4230
4331
|
import_koishi17.Schema.union([
|
|
4231
4332
|
import_koishi17.Schema.object({
|
|
@@ -4248,6 +4349,7 @@ var Config = import_koishi17.Schema.intersect([
|
|
|
4248
4349
|
alias: import_koishi17.Schema.string().required()
|
|
4249
4350
|
})
|
|
4250
4351
|
).default([]).role("table"),
|
|
4352
|
+
autoRecallTips: import_koishi17.Schema.boolean().default(true),
|
|
4251
4353
|
rankBroadSwitch: import_koishi17.Schema.boolean().default(false)
|
|
4252
4354
|
}).i18n(getI18n("message")),
|
|
4253
4355
|
import_koishi17.Schema.union([
|
|
@@ -4285,9 +4387,9 @@ var Config = import_koishi17.Schema.intersect([
|
|
|
4285
4387
|
]).i18n(getI18n("report"))
|
|
4286
4388
|
]),
|
|
4287
4389
|
import_koishi17.Schema.object({
|
|
4288
|
-
template_match: import_koishi17.Schema.union([...readDirectoryFilesSync(
|
|
4289
|
-
template_player: import_koishi17.Schema.union([...readDirectoryFilesSync(
|
|
4290
|
-
template_hero: import_koishi17.Schema.union([...readDirectoryFilesSync(
|
|
4390
|
+
template_match: import_koishi17.Schema.union([...readDirectoryFilesSync(import_path3.default.join(templateDir, "match"))]).default("match_1"),
|
|
4391
|
+
template_player: import_koishi17.Schema.union([...readDirectoryFilesSync(import_path3.default.join(templateDir, "player"))]).default("player_1"),
|
|
4392
|
+
template_hero: import_koishi17.Schema.union([...readDirectoryFilesSync(import_path3.default.join(templateDir, "hero"))]).default("hero_1"),
|
|
4291
4393
|
playerRankEstimate: import_koishi17.Schema.boolean().default(true),
|
|
4292
4394
|
templateFonts: import_koishi17.Schema.array(String).default([]).role("table")
|
|
4293
4395
|
}).i18n(getI18n("template"))
|
|
@@ -4305,7 +4407,7 @@ __name(getI18n, "getI18n");
|
|
|
4305
4407
|
function readDirectoryFilesSync(directoryPath) {
|
|
4306
4408
|
try {
|
|
4307
4409
|
const files = import_fs3.default.readdirSync(directoryPath);
|
|
4308
|
-
const fileNames = files.filter((file) =>
|
|
4410
|
+
const fileNames = files.filter((file) => import_path3.default.extname(file).toLowerCase() === ".ejs").map((file) => import_path3.default.basename(file, ".ejs"));
|
|
4309
4411
|
return fileNames;
|
|
4310
4412
|
} catch (error) {
|
|
4311
4413
|
console.error("Error reading directory:", error);
|
|
@@ -4325,14 +4427,15 @@ async function apply(ctx, config) {
|
|
|
4325
4427
|
const lib = await import("dotaconstants");
|
|
4326
4428
|
const dotaconstants = lib.default || lib;
|
|
4327
4429
|
const logger = ctx.logger("dota2tracker");
|
|
4328
|
-
const currentDir =
|
|
4329
|
-
const pluginVersion = require(
|
|
4430
|
+
const currentDir = import_path4.default.resolve(__dirname);
|
|
4431
|
+
const pluginVersion = require(import_path4.default.join(currentDir, "..", "package.json")).version;
|
|
4330
4432
|
ctx.dota2tracker = {};
|
|
4331
|
-
ctx.dota2tracker.
|
|
4332
|
-
ctx.dota2tracker.
|
|
4433
|
+
ctx.dota2tracker.dotaconstants = dotaconstants;
|
|
4434
|
+
ctx.dota2tracker.i18n = new I18NService(ctx);
|
|
4435
|
+
ctx.dota2tracker.image = new ImageRenderer(ctx, currentDir);
|
|
4333
4436
|
ctx.dota2tracker.messageBuilder = new MessageBuilder(ctx);
|
|
4334
|
-
ctx.dota2tracker.match = new MatchService(ctx, pluginVersion
|
|
4335
|
-
ctx.dota2tracker.player = new PlayerService(ctx
|
|
4437
|
+
ctx.dota2tracker.match = new MatchService(ctx, pluginVersion);
|
|
4438
|
+
ctx.dota2tracker.player = new PlayerService(ctx);
|
|
4336
4439
|
if (ctx.cron) {
|
|
4337
4440
|
ctx.dota2tracker.matchWatcher = new MatchWatcherTask(ctx);
|
|
4338
4441
|
ctx.dota2tracker.parsePolling = new ParsePollingTask(ctx);
|
|
@@ -4344,7 +4447,7 @@ async function apply(ctx, config) {
|
|
|
4344
4447
|
} else {
|
|
4345
4448
|
logger.info(ctx.dota2tracker.i18n.gt("dota2tracker.logger.cron_not_enabled"));
|
|
4346
4449
|
}
|
|
4347
|
-
ctx.dota2tracker.hero = new HeroService(ctx
|
|
4450
|
+
ctx.dota2tracker.hero = new HeroService(ctx);
|
|
4348
4451
|
ctx.dota2tracker.item = new ItemService(ctx);
|
|
4349
4452
|
ctx.dota2tracker.cache = new CacheService(ctx);
|
|
4350
4453
|
ctx.dota2tracker.database = new DatabaseService(ctx);
|
|
@@ -4352,7 +4455,7 @@ async function apply(ctx, config) {
|
|
|
4352
4455
|
ctx.dota2tracker.stratzAPI = new StratzAPI(ctx, currentDir);
|
|
4353
4456
|
if (config.enableOpenDotaFallback) {
|
|
4354
4457
|
ctx.dota2tracker.opendotaAPI = new OpenDotaAPI(ctx);
|
|
4355
|
-
ctx.dota2tracker.opendotaAdapter = new OpenDotaAdapter(ctx
|
|
4458
|
+
ctx.dota2tracker.opendotaAdapter = new OpenDotaAdapter(ctx);
|
|
4356
4459
|
}
|
|
4357
4460
|
ctx.dota2tracker = ctx.dota2tracker;
|
|
4358
4461
|
usage = await ctx.dota2tracker.i18n.generateUsage();
|
|
@@ -4365,7 +4468,6 @@ async function apply(ctx, config) {
|
|
|
4365
4468
|
registerQueryHeroCommand(ctx);
|
|
4366
4469
|
registerQueryItemCommand(ctx);
|
|
4367
4470
|
registerHeroOfTheDayCommand(ctx);
|
|
4368
|
-
if (ctx.console && config.enableConsole) registerConsolePage(ctx);
|
|
4369
4471
|
}
|
|
4370
4472
|
__name(apply, "apply");
|
|
4371
4473
|
// Annotate the CommonJS export names for ESM import in node:
|