koishi-plugin-wcl-lili 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +58 -12
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2325,9 +2325,14 @@ function normHeroEn(s) {
|
|
|
2325
2325
|
return s.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
2326
2326
|
}
|
|
2327
2327
|
var _HERO_NORM_IDX = Object.entries(HERO_EN_CN).map(([en, zh]) => ({ ne: normHeroEn(en), zh }));
|
|
2328
|
+
var HERO_ZH_ALIAS = {
|
|
2329
|
+
// 常见同音/形近变体(用户输入 → 表内标准译名)
|
|
2330
|
+
\u8428\u83B1\u8335: "\u8428\u83B1\u56E0"
|
|
2331
|
+
};
|
|
2328
2332
|
function matchHeroToken(t) {
|
|
2329
2333
|
const s = (t || "").trim();
|
|
2330
2334
|
if (!s) return null;
|
|
2335
|
+
if (HERO_ZH_ALIAS[s]) return HERO_ZH_ALIAS[s];
|
|
2331
2336
|
for (const zh of Object.values(HERO_EN_CN)) if (zh === s) return zh;
|
|
2332
2337
|
const nq = normHeroEn(s);
|
|
2333
2338
|
if (nq.length < 3) return null;
|
|
@@ -2341,12 +2346,39 @@ function parseTrinketContext(t) {
|
|
|
2341
2346
|
return null;
|
|
2342
2347
|
}
|
|
2343
2348
|
var TRINKET_DEFAULT_HERO = {
|
|
2344
|
-
"
|
|
2345
|
-
|
|
2349
|
+
"death_knight.blood": "San'layn",
|
|
2350
|
+
"death_knight.unholy": "Rider",
|
|
2351
|
+
"demon_hunter.devourer": "Void-Scarred",
|
|
2352
|
+
"demon_hunter.havoc": "Fel-Scarred",
|
|
2353
|
+
"demon_hunter.vengeance": "Annihilator",
|
|
2354
|
+
"druid.balance": "Elune's Chosen",
|
|
2355
|
+
"druid.feral": "Druid of the Claw",
|
|
2356
|
+
"druid.guardian": "Druid of the Claw",
|
|
2357
|
+
"evoker.augmentation": "Chronowarden",
|
|
2358
|
+
"evoker.devastation": "Flameshaper",
|
|
2359
|
+
"mage.arcane": "Spellslinger",
|
|
2360
|
+
"mage.fire": "Sunfury",
|
|
2361
|
+
"mage.frost": "Spellslinger",
|
|
2362
|
+
"paladin.retribution": "Herald of the Sun",
|
|
2363
|
+
"priest.shadow": "Voidweaver",
|
|
2364
|
+
"rogue.assassination": "Deathstalker",
|
|
2365
|
+
"shaman.elemental": "Farseer",
|
|
2366
|
+
"shaman.enhancement": "Stormbringer",
|
|
2367
|
+
"warlock.affliction": "Soul Harvester",
|
|
2368
|
+
"warlock.demonology": "Soulharvester",
|
|
2369
|
+
"warlock.destruction": "Hellcaller"
|
|
2346
2370
|
};
|
|
2347
2371
|
function profileHeroEn(name2) {
|
|
2348
2372
|
return (name2 || "").replace(/^(?:SimulationCraft|Liquid Generated)\s*-\s*(?:M\+\s*)?/i, "").trim();
|
|
2349
2373
|
}
|
|
2374
|
+
var TRINKET_GEN_ALIAS = {
|
|
2375
|
+
liquid: "liquid",
|
|
2376
|
+
\u6DB2\u4F53: "liquid",
|
|
2377
|
+
\u674E\u9035: "liquid",
|
|
2378
|
+
\u674E\u594E: "liquid",
|
|
2379
|
+
simc: "simc",
|
|
2380
|
+
simulationcraft: "simc"
|
|
2381
|
+
};
|
|
2350
2382
|
function profileHeroZh(name2) {
|
|
2351
2383
|
const en = profileHeroEn(name2);
|
|
2352
2384
|
if (!en || /^default$/i.test(en)) return "";
|
|
@@ -2659,13 +2691,16 @@ function selectLiquidBars(data, cls, spec, simStyle, opts) {
|
|
|
2659
2691
|
const mplus = !!opts?.mplus;
|
|
2660
2692
|
const specData = data?.[titleKey(cls)]?.[titleKey(spec)];
|
|
2661
2693
|
if (!specData || !specData.profiles?.length) return { error: "no-profile", available: [], profile: "", heroZh: "", mplus };
|
|
2662
|
-
|
|
2663
|
-
|
|
2694
|
+
let ctxProfiles = specData.profiles.filter((p) => /M\+/.test(p.name) === mplus);
|
|
2695
|
+
const genRe = opts?.gen === "simc" ? /^SimulationCraft/i : opts?.gen === "liquid" ? /^Liquid Generated/i : null;
|
|
2696
|
+
if (genRe) ctxProfiles = ctxProfiles.filter((p) => genRe.test(p.name));
|
|
2697
|
+
if (!ctxProfiles.length) return { error: genRe ? "gen-not-found" : "no-profile", available: [], profile: "", heroZh: "", mplus };
|
|
2664
2698
|
const pool = ctxProfiles;
|
|
2665
|
-
const availableZh = [...new Set(
|
|
2699
|
+
const availableZh = [...new Set(ctxProfiles.map((p) => profileHeroZh(p.name)).filter(Boolean))];
|
|
2666
2700
|
let profile = null;
|
|
2667
2701
|
if (opts?.heroZh) {
|
|
2668
|
-
const
|
|
2702
|
+
const wantZh = HERO_ZH_ALIAS[opts.heroZh] || opts.heroZh;
|
|
2703
|
+
const wantEn = Object.entries(HERO_EN_CN).find(([, zh]) => zh === wantZh)?.[0] || wantZh;
|
|
2669
2704
|
const nq = normHeroEn(wantEn);
|
|
2670
2705
|
if (!nq) return { error: "hero-not-found", available: availableZh, profile: "", heroZh: opts.heroZh, mplus };
|
|
2671
2706
|
profile = pool.find((p) => {
|
|
@@ -2985,6 +3020,7 @@ function renderTrinketLiquidHtml(opts) {
|
|
|
2985
3020
|
<div class="la_wow_sim_profile__settings">
|
|
2986
3021
|
<div class="tl_select"><label class="tl_select__label">\u6D41\u6D3E</label><div class="tl_select__selector"><span class="select_trigger"><span class="select_trigger__label">${e(sel.heroZh || "\u9ED8\u8BA4")} \xB7 ${sel.mplus ? "\u5927\u79D8\u5883" : "\u56E2\u672C"}</span>${chevron}</span></div></div>
|
|
2987
3022
|
<div class="tl_select" style="flex:0 0 96px"><label class="tl_select__label">\u76EE\u6807\u6570</label><div class="tl_select__selector"><span class="select_trigger"><span class="select_trigger__label">${e(targetCn)}</span>${chevron}</span></div></div>
|
|
3023
|
+
${opts.genZh ? `<div class="tl_select" style="flex:0 0 96px"><label class="tl_select__label">\u4EE3\u6B21</label><div class="tl_select__selector"><span class="select_trigger"><span class="select_trigger__label">${e(opts.genZh)}</span>${chevron}</span></div></div>` : ""}
|
|
2988
3024
|
</div>
|
|
2989
3025
|
<div class="la_wow_sim_profile__simcraft_data"><p>SimulationCraft \u6A21\u62DF \xB7 Liquid \u516C\u4F1A</p><p>\u6570\u636E\u6E90 liquidarmory.com Trinket Tracker</p></div>
|
|
2990
3026
|
</div>
|
|
@@ -4441,7 +4477,7 @@ ${raid}`;
|
|
|
4441
4477
|
return `\u274C \u751F\u6210\u56E2\u672C\u5F3A\u5EA6\u56FE\u5931\u8D25\uFF1A${e.message || "\u672A\u77E5\u9519\u8BEF"}`;
|
|
4442
4478
|
}
|
|
4443
4479
|
});
|
|
4444
|
-
ctx.command("wcl.\u9970\u54C1 <spec:text>", "\u67E5\u8BE2\u4E13\u7CBE BIS \u9970\u54C1\u5F3A\u5EA6\u699C\uFF08\u8F93\u51FA\u5411=liquidarmory \u590D\u523B\u6837\u5F0F\uFF0C\u6CBB\u7597\u5411=questionablyepic \u6570\u636E\uFF0C\u5168\u4E2D\u6587\uFF09").example("wcl.\u9970\u54C1 \u9C9C\u8840 5 \u2014 \u9C9C\u8840 DK 5 \u76EE\u6807\u573A\u666F\uFF0C\u5168\u90E8\u9970\u54C1").example("wcl.\u9970\u54C1 \u6CD5\u5E08-\u51B0\u971C 1 \u2014 \u6CD5\u5E08\u51B0\u971C\u5355\u76EE\u6807").example("wcl.\u9970\u54C1 \u566C\u706D 3 15 \u2014 \u566C\u706D 3 \u76EE\u6807\uFF0C\u53EA\u770B\u524D 15 \u540D").example("wcl.\u9970\u54C1 \u6E6E\u706D \u5851\u7130\u8005 5 \u2014 \u6E6E\u706D\u5524\u9B54\u5E08\u5851\u7130\u8005\u6D41\u6D3E 5 \u76EE\u6807\uFF08\u9ED8\u8BA4\u9CDE\u957F\uFF09").example("wcl.\u9970\u54C1 \u5FB7\u9C81\u4F0A-\u6062\u590D \u2014 \u6062\u590D\u5FB7\u6CBB\u7597\u9970\u54C1\u699C\uFF08\u9ED8\u8BA4\u5927\u79D8\u5883\uFF0C\u52A0\u300C\u56E2\u672C\u300D\u5207\u6362\uFF09").usage("\u683C\u5F0F\uFF1Awcl.\u9970\u54C1 \u4E13\u7CBE [\u82F1\u96C4\u5929\u8D4B] [\u56E2\u672C/\u5927\u79D8\u5883] [\u6570\u5B57]\uFF0C\u5404\u540E\u7F00\u4F4D\u7F6E\u4E0D\u9650\u3002\n\u4E13\u7CBE\u652F\u6301\u4E2D\u6587\uFF08\u9C9C\u8840/\u51B0\u971C/\u566C\u706D \u7B49\uFF09\u3002\u91CD\u540D\u4E13\u7CBE\uFF08\u51B0\u971C=DK/\u6CD5\u5E08\u3001\u6062\u590D=\u5FB7/\u8428\u3001\u795E\u5723=\u9A91/\u7267\u3001\u9632\u62A4=\u9A91/\u6218\uFF09\u8BF7\u7528\u300C\u804C\u4E1A-\u4E13\u7CBE\u300D\uFF0C\u5982\u300C\u6CD5\u5E08-\u51B0\u971C\u300D\u3002\n\u82F1\u96C4\u5929\u8D4B\uFF1A\u8F93\u51FA\u5411\u4E13\u7CBE\u53EF\u6307\u5B9A\u6D41\u6D3E\uFF08\u5982 \u6E6E\u706D\u2192\u9CDE\u957F/\u5851\u7130\u8005\uFF0C\u90AA\u6076\u2192\u5929\u542F\u9A91\u58EB/\u6B7B\u4EA1\u4F7F\u8005 \u7B49\uFF0C\u652F\u6301\u4E2D\u6587\u6216\u82F1\u6587\uFF09\uFF0C\u9ED8\u8BA4\u53D6\u4E3B\u6D41\u6D41\u6D3E\u3002\n\u76EE\u6807\u6570\u4EC5\u652F\u6301 1 / 3 / 5\uFF0C\u9ED8\u8BA4 1\uFF1B\u6570\u5B57\u81EA\u52A8\u8BC6\u522B\uFF081/3/5=\u76EE\u6807\u6570\uFF0C\u5176\u4ED6=\u6700\u591A N \u6761\uFF09\uFF0C\u4F4D\u7F6E\u4E0D\u9650\u3002\n\u60C5\u5883\uFF1A\u9ED8\u8BA4\u67E5\u8BE2\u5927\u79D8\u5883\uFF0C\u53EF\u7528\u300C\u56E2\u672C/\u5927\u79D8\u5883\u300D\u5207\u6362\uFF1B\u65E0\u5927\u79D8\u5883\u6570\u636E\u7684\u4E13\u7CBE\u81EA\u52A8\u56DE\u9000\u56E2\u672C\uFF08\u4F1A\u63D0\u793A\uFF09\u3002\n\u6CBB\u7597\u4E13\u7CBE\uFF08\u6062\u590D\u5FB7/\u6062\u590D\u8428/\u795E\u5723\u9A91/\u795E\u5723\u7267/\u6212\u5F8B\u7267/\u7EC7\u96FE/\u62A4\u5B58\u8005\uFF09\uFF1A\u6570\u636E\u6E90 QE Live \u6CBB\u7597\u6A21\u62DF\uFF08HPS\uFF09\uFF0C\u540C\u6837\u9ED8\u8BA4\u5927\u79D8\u5883\u3002\n\u6570\u636E\u6E90\uFF1Aliquidarmory.com Trinket Tracker\uFF081:1 \u590D\u523B\u539F\u7AD9\u4E09\u8272\u6761\u7EB9\u6837\u5F0F\uFF09\u3002").action(wrapOutput(config, async (argv, specRaw) => {
|
|
4480
|
+
ctx.command("wcl.\u9970\u54C1 <spec:text>", "\u67E5\u8BE2\u4E13\u7CBE BIS \u9970\u54C1\u5F3A\u5EA6\u699C\uFF08\u8F93\u51FA\u5411=liquidarmory \u590D\u523B\u6837\u5F0F\uFF0C\u6CBB\u7597\u5411=questionablyepic \u6570\u636E\uFF0C\u5168\u4E2D\u6587\uFF09").example("wcl.\u9970\u54C1 \u9C9C\u8840 5 \u2014 \u9C9C\u8840 DK 5 \u76EE\u6807\u573A\u666F\uFF0C\u5168\u90E8\u9970\u54C1").example("wcl.\u9970\u54C1 \u6CD5\u5E08-\u51B0\u971C 1 \u2014 \u6CD5\u5E08\u51B0\u971C\u5355\u76EE\u6807").example("wcl.\u9970\u54C1 \u566C\u706D 3 15 \u2014 \u566C\u706D 3 \u76EE\u6807\uFF0C\u53EA\u770B\u524D 15 \u540D").example("wcl.\u9970\u54C1 \u6E6E\u706D \u5851\u7130\u8005 5 \u2014 \u6E6E\u706D\u5524\u9B54\u5E08\u5851\u7130\u8005\u6D41\u6D3E 5 \u76EE\u6807\uFF08\u9ED8\u8BA4\u9CDE\u957F\uFF09").example("wcl.\u9970\u54C1 \u5FB7\u9C81\u4F0A-\u6062\u590D \u2014 \u6062\u590D\u5FB7\u6CBB\u7597\u9970\u54C1\u699C\uFF08\u9ED8\u8BA4\u5927\u79D8\u5883\uFF0C\u52A0\u300C\u56E2\u672C\u300D\u5207\u6362\uFF09").example("wcl.\u9970\u54C1 \u9C9C\u8840 simc \u2014 \u9C9C\u8840 DK \u56E2\u672C SimC \u4EE3\u6A21\u62DF\uFF08\u4E0D\u6307\u5B9A\u4EE3\u6B21 = \u4E0E\u7F51\u7AD9\u9ED8\u8BA4\u4E00\u81F4\uFF09").usage("\u683C\u5F0F\uFF1Awcl.\u9970\u54C1 \u4E13\u7CBE [\u82F1\u96C4\u5929\u8D4B] [\u56E2\u672C/\u5927\u79D8\u5883] [\u4EE3\u6B21] [\u6570\u5B57]\uFF0C\u5404\u540E\u7F00\u4F4D\u7F6E\u4E0D\u9650\u3002\n\u4E13\u7CBE\u652F\u6301\u4E2D\u6587\uFF08\u9C9C\u8840/\u51B0\u971C/\u566C\u706D \u7B49\uFF09\u3002\u91CD\u540D\u4E13\u7CBE\uFF08\u51B0\u971C=DK/\u6CD5\u5E08\u3001\u6062\u590D=\u5FB7/\u8428\u3001\u795E\u5723=\u9A91/\u7267\u3001\u9632\u62A4=\u9A91/\u6218\uFF09\u8BF7\u7528\u300C\u804C\u4E1A-\u4E13\u7CBE\u300D\uFF0C\u5982\u300C\u6CD5\u5E08-\u51B0\u971C\u300D\u3002\n\u82F1\u96C4\u5929\u8D4B\uFF1A\u8F93\u51FA\u5411\u4E13\u7CBE\u53EF\u6307\u5B9A\u6D41\u6D3E\uFF08\u5982 \u6E6E\u706D\u2192\u9CDE\u957F/\u5851\u7130\u8005\uFF0C\u90AA\u6076\u2192\u5929\u542F\u9A91\u58EB/\u6B7B\u4EA1\u4F7F\u8005 \u7B49\uFF0C\u652F\u6301\u4E2D\u6587\u6216\u82F1\u6587\uFF09\uFF0C\u9ED8\u8BA4\u53D6\u4E3B\u6D41\u6D41\u6D3E\u3002\n\u76EE\u6807\u6570\u4EC5\u652F\u6301 1 / 3 / 5\uFF0C\u9ED8\u8BA4 1\uFF1B\u6570\u5B57\u81EA\u52A8\u8BC6\u522B\uFF081/3/5=\u76EE\u6807\u6570\uFF0C\u5176\u4ED6=\u6700\u591A N \u6761\uFF09\uFF0C\u4F4D\u7F6E\u4E0D\u9650\u3002\n\u60C5\u5883\uFF1A\u9ED8\u8BA4\u67E5\u8BE2\u5927\u79D8\u5883\uFF0C\u53EF\u7528\u300C\u56E2\u672C/\u5927\u79D8\u5883\u300D\u5207\u6362\uFF1B\u65E0\u5927\u79D8\u5883\u6570\u636E\u7684\u4E13\u7CBE\u81EA\u52A8\u56DE\u9000\u56E2\u672C\uFF08\u4F1A\u63D0\u793A\uFF09\u3002\n\u4EE3\u6B21\uFF1Aliquidarmory \u6709 SimulationCraft / Liquid Generated \u4E24\u4EE3\u6A21\u62DF\uFF0C\u53EF\u7528 simc/simulationcraft \u6216 liquid/\u6DB2\u4F53/\u674E\u9035/\u674E\u594E \u6307\u5B9A\uFF0C\u4E0D\u6307\u5B9A\u65F6\u53D6\u6570\u636E\u987A\u5E8F\u9996\u4E2A\uFF08\u4E0E\u7F51\u7AD9\u9ED8\u8BA4\u4E00\u81F4\uFF09\u3002\n\u6CBB\u7597\u4E13\u7CBE\uFF08\u6062\u590D\u5FB7/\u6062\u590D\u8428/\u795E\u5723\u9A91/\u795E\u5723\u7267/\u6212\u5F8B\u7267/\u7EC7\u96FE/\u62A4\u5B58\u8005\uFF09\uFF1A\u6570\u636E\u6E90 QE Live \u6CBB\u7597\u6A21\u62DF\uFF08HPS\uFF09\uFF0C\u540C\u6837\u9ED8\u8BA4\u5927\u79D8\u5883\u3002\n\u6570\u636E\u6E90\uFF1Aliquidarmory.com Trinket Tracker\uFF081:1 \u590D\u523B\u539F\u7AD9\u4E09\u8272\u6761\u7EB9\u6837\u5F0F\uFF09\u3002").action(wrapOutput(config, async (argv, specRaw) => {
|
|
4445
4481
|
const session = argv?.session;
|
|
4446
4482
|
const guard = await checkQueryQuota(ctx, session, config.queryQuota);
|
|
4447
4483
|
if (guard) return guard;
|
|
@@ -4462,8 +4498,14 @@ ${raid}`;
|
|
|
4462
4498
|
}
|
|
4463
4499
|
let heroZh = null;
|
|
4464
4500
|
let context = null;
|
|
4501
|
+
let gen = null;
|
|
4465
4502
|
const leftover = [];
|
|
4466
4503
|
for (const t of words) {
|
|
4504
|
+
const g = TRINKET_GEN_ALIAS[t.toLowerCase()];
|
|
4505
|
+
if (g) {
|
|
4506
|
+
gen = g;
|
|
4507
|
+
continue;
|
|
4508
|
+
}
|
|
4467
4509
|
const c = parseTrinketContext(t);
|
|
4468
4510
|
if (c) {
|
|
4469
4511
|
context = c;
|
|
@@ -4520,14 +4562,18 @@ ${raid}`;
|
|
|
4520
4562
|
if (!r) {
|
|
4521
4563
|
return "\u274C \u62C9\u53D6 liquidarmory.com Trinket Tracker \u6570\u636E\u5931\u8D25\uFF08\u7F51\u7EDC\u5F02\u5E38\u6216\u9875\u9762\u7ED3\u6784\u53D8\u5316\uFF09\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002";
|
|
4522
4564
|
}
|
|
4523
|
-
let sel = selectLiquidBars(r.data, hit.cls, hit.spec, simStyle, { heroZh, mplus: context !== "raid" });
|
|
4565
|
+
let sel = selectLiquidBars(r.data, hit.cls, hit.spec, simStyle, { heroZh, mplus: context !== "raid", gen });
|
|
4524
4566
|
let fallbackNote = "";
|
|
4525
|
-
if ("error" in sel && !context && sel.error === "no-profile") {
|
|
4526
|
-
sel = selectLiquidBars(r.data, hit.cls, hit.spec, simStyle, { heroZh, mplus: false });
|
|
4567
|
+
if ("error" in sel && !context && (sel.error === "no-profile" || sel.error === "gen-not-found")) {
|
|
4568
|
+
sel = selectLiquidBars(r.data, hit.cls, hit.spec, simStyle, { heroZh, mplus: false, gen });
|
|
4527
4569
|
if (!("error" in sel)) fallbackNote = "\u2139\uFE0F \u8BE5\u4E13\u7CBE\u6682\u65E0\u5927\u79D8\u5883\u6A21\u62DF\u6570\u636E\uFF0C\u4EE5\u4E0B\u4E3A\u56E2\u672C\u6570\u636E\u3002";
|
|
4528
4570
|
}
|
|
4529
4571
|
if ("error" in sel) {
|
|
4530
4572
|
const zhSpec = specNameMap[specSlugToEn[hit.spec]] || hit.spec;
|
|
4573
|
+
if (sel.error === "gen-not-found") {
|
|
4574
|
+
const genName = gen === "simc" ? "SimulationCraft" : "Liquid Generated";
|
|
4575
|
+
return `\u274C ${CLASS_CN[hit.cls] || hit.cls}${zhSpec}\u6CA1\u6709\u300C${genName}\u300D\u4EE3\u6B21\u7684${sel.mplus ? "\u5927\u79D8\u5883" : "\u56E2\u672C"}\u6A21\u62DF\u6570\u636E\u3002\u53EF\u53BB\u6389\u4EE3\u6B21\u8BCD\u91CD\u8BD5\uFF0C\u6216\u6362 ${gen === "simc" ? "Liquid\uFF08\u6DB2\u4F53\uFF09" : "SimC"} \u4EE3\u6B21\u3002`;
|
|
4576
|
+
}
|
|
4531
4577
|
if (sel.error === "hero-not-found") {
|
|
4532
4578
|
const avail = sel.available.length ? sel.available.join("\u3001") : "\u65E0";
|
|
4533
4579
|
return `\u274C ${CLASS_CN[hit.cls] || hit.cls}${zhSpec}\u6CA1\u6709\u300C${sel.heroZh}\u300D\u6D41\u6D3E\u6570\u636E\u3002\u53EF\u7528\u6D41\u6D3E\uFF1A${avail}`;
|
|
@@ -4537,14 +4583,14 @@ ${raid}`;
|
|
|
4537
4583
|
}
|
|
4538
4584
|
if (fallbackNote && session) await session.send(fallbackNote);
|
|
4539
4585
|
const updated = new Date(r.ts * 1e3).toISOString().slice(0, 10);
|
|
4540
|
-
const pngKey = `l|${hit.cls}|${hit.spec}|${sel.heroZh || ""}|${sel.mplus ? 1 : 0}|${tgt}|${topN}|${config.theme}`;
|
|
4586
|
+
const pngKey = `l|${hit.cls}|${hit.spec}|${gen || ""}|${sel.heroZh || ""}|${sel.mplus ? 1 : 0}|${tgt}|${topN}|${config.theme}`;
|
|
4541
4587
|
const cachedBuf = await trinketPngGet(pngKey);
|
|
4542
4588
|
if (cachedBuf) {
|
|
4543
4589
|
await sendImageMaybeFold(config, session, cachedBuf);
|
|
4544
4590
|
return;
|
|
4545
4591
|
}
|
|
4546
4592
|
const icons = await trinketIconMap(sel.bars.map((b) => b.iconId));
|
|
4547
|
-
const html = renderTrinketLiquidHtml({ cls: hit.cls, spec: hit.spec, sel, topN, simStyle, updated, theme: config.theme, icons });
|
|
4593
|
+
const html = renderTrinketLiquidHtml({ cls: hit.cls, spec: hit.spec, sel, topN, simStyle, updated, theme: config.theme, genZh: gen === "simc" ? "SimC" : gen === "liquid" ? "Liquid" : void 0, icons });
|
|
4548
4594
|
const buf = await renderPng(html, ctx, 480);
|
|
4549
4595
|
if (!buf) return "\u274C \u56FE\u7247\u751F\u6210\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002";
|
|
4550
4596
|
await trinketPngSet(pngKey, buf);
|