koishi-plugin-warframe 1.4.11 → 1.4.13
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.d.ts +6 -0
- package/lib/index.js +67 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import WorldState from 'warframe-worldstate-parser';
|
|
|
5
5
|
import { RivenWeaponDisposition, RivenStatFixFactorMap } from '../../types/wf/riven';
|
|
6
6
|
import { RivenStatAnalyzeResult, RivenStatResult } from '../types/wf/riven';
|
|
7
7
|
import Element from '@satorijs/element';
|
|
8
|
+
import { RivenWeaponItem } from '../../types/miscs/lab';
|
|
9
|
+
import { RivenWeaponItem } from '../types/miscs/lab';
|
|
8
10
|
export const toTimeStamp: (timeStr: string) => number;
|
|
9
11
|
/**
|
|
10
12
|
* 毫秒转「X小时X分钟X秒」格式(0单位不显示)
|
|
@@ -637,6 +639,10 @@ export const RivenOrderComponent: (item: RivenItem, orders: RivenOrderInternal[]
|
|
|
637
639
|
export const wmCommand: (action: Argv, input: string) => Promise<string>;
|
|
638
640
|
export const wmrCommand: (action: Argv, input: string) => Promise<string>;
|
|
639
641
|
export const wmuCommand: (action: Argv, input: string) => Promise<string>;
|
|
642
|
+
export const getHotRivenWeapons: (num?: number) => Promise<RivenWeaponItem[] | undefined>;
|
|
643
|
+
export const globalHotRivenWeapons: AsyncCache<import("types/miscs/lab").RivenWeaponItem[]>;
|
|
644
|
+
export const HotRivenComponent: (data: RivenWeaponItem[]) => Element;
|
|
645
|
+
export const hotRivenCommand: (action: Argv) => Promise<string>;
|
|
640
646
|
export const onReadyHandler: () => Promise<void>;
|
|
641
647
|
export const name = "warframe";
|
|
642
648
|
export interface Config {
|
package/lib/index.js
CHANGED
|
@@ -2175,6 +2175,13 @@ var incarnons = [
|
|
|
2175
2175
|
"/Lotus/Language/Items/CorpusMinigunName",
|
|
2176
2176
|
"/Lotus/Language/Items/BurstPistolName",
|
|
2177
2177
|
"/Lotus/Language/Items/TennoSaiName"
|
|
2178
|
+
],
|
|
2179
|
+
[
|
|
2180
|
+
"/Lotus/Language/Items/TennoSniperRifleName",
|
|
2181
|
+
"/Lotus/Language/Items/GrineerGooGunName",
|
|
2182
|
+
"/Lotus/Language/Items/AutoCrossBowName",
|
|
2183
|
+
"/Lotus/Language/Items/TnoRapierName",
|
|
2184
|
+
"/Lotus/Language/Items/CorpusPunchKickWeaponName"
|
|
2178
2185
|
]
|
|
2179
2186
|
];
|
|
2180
2187
|
var warframes = [
|
|
@@ -52639,6 +52646,65 @@ var wmuCommand = /* @__PURE__ */ __name(async (action, input) => {
|
|
|
52639
52646
|
return await updateCache();
|
|
52640
52647
|
}, "wmuCommand");
|
|
52641
52648
|
|
|
52649
|
+
// src/infrastructure/miscs/lab-api.ts
|
|
52650
|
+
var getHotRivenWeapons = /* @__PURE__ */ __name(async (num = 30) => {
|
|
52651
|
+
const response = await fetchAsyncData(
|
|
52652
|
+
`https://lab.webutilitykit.com/api/RivenTracker/hot-weapons?limit=${num}&sortBy=price`
|
|
52653
|
+
);
|
|
52654
|
+
return response?.data;
|
|
52655
|
+
}, "getHotRivenWeapons");
|
|
52656
|
+
|
|
52657
|
+
// src/data/miscs/lab.ts
|
|
52658
|
+
var globalHotRivenWeapons = createAsyncCache(async () => {
|
|
52659
|
+
const items = await getHotRivenWeapons(40);
|
|
52660
|
+
return items || [];
|
|
52661
|
+
}, 18e5);
|
|
52662
|
+
|
|
52663
|
+
// src/components/miscs.tsx
|
|
52664
|
+
var import_jsx_runtime3 = require("@satorijs/element/jsx-runtime");
|
|
52665
|
+
var HotRivenComponent = /* @__PURE__ */ __name((data) => {
|
|
52666
|
+
const displayData = data.slice(0, 20);
|
|
52667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: "width: 600px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; background-color: #f8f9fa; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;", children: displayData.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: "display: flex; align-items: center; justify-content: space-between; gap: 4px; background-color: #ffffff; padding: 8px 10px; border-radius: 6px; border: 1px solid #e8ecf0;", children: [
|
|
52668
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: "flex: 1; min-width: 0; max-width: 60%;", children: [
|
|
52669
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: "display: flex; align-items: baseline; gap: 4px;", children: [
|
|
52670
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: "font-size: 13px; font-weight: 600; color: #1a2332; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", children: item.name_zh }),
|
|
52671
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: "font-size: 10px; color: #6b7a8f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", children: item.name_en })
|
|
52672
|
+
] }),
|
|
52673
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: "display: flex; align-items: center; gap: 4px; margin-top: 1px; flex-wrap: wrap;", children: [
|
|
52674
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { style: "font-size: 11px; font-weight: 500; color: #1a2332;", children: [
|
|
52675
|
+
"倾向 ",
|
|
52676
|
+
item.disposition.toFixed(2)
|
|
52677
|
+
] }),
|
|
52678
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: "font-size: 10px; color: #9aabb8;", children: "·" }),
|
|
52679
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { style: "font-size: 10px; color: #6b7a8f;", children: [
|
|
52680
|
+
"🟢在线 ",
|
|
52681
|
+
item.active_count
|
|
52682
|
+
] })
|
|
52683
|
+
] })
|
|
52684
|
+
] }),
|
|
52685
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: "text-align: right; flex-shrink: 0;", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: "font-size: 16px; font-weight: 700; color: #2d7a6d;", children: [
|
|
52686
|
+
item.bottom_price,
|
|
52687
|
+
"p"
|
|
52688
|
+
] }) })
|
|
52689
|
+
] })) });
|
|
52690
|
+
}, "HotRivenComponent");
|
|
52691
|
+
|
|
52692
|
+
// src/commands/miscs.ts
|
|
52693
|
+
var hotRivenCommand = /* @__PURE__ */ __name(async (action) => {
|
|
52694
|
+
try {
|
|
52695
|
+
const result = await globalHotRivenWeapons.get();
|
|
52696
|
+
if (!result || result.length === 0) {
|
|
52697
|
+
return "暂无热门紫卡数据。";
|
|
52698
|
+
}
|
|
52699
|
+
return await generateImageOutput(
|
|
52700
|
+
action.session.app.puppeteer,
|
|
52701
|
+
HotRivenComponent(result)
|
|
52702
|
+
);
|
|
52703
|
+
} catch (error) {
|
|
52704
|
+
return "获取热门紫卡数据失败";
|
|
52705
|
+
}
|
|
52706
|
+
}, "hotRivenCommand");
|
|
52707
|
+
|
|
52642
52708
|
// src/hooks/on-ready.ts
|
|
52643
52709
|
var onReadyHandler = /* @__PURE__ */ __name(async () => {
|
|
52644
52710
|
await wmOnReady();
|
|
@@ -52703,6 +52769,7 @@ var setupCommands = /* @__PURE__ */ __name((ctx) => {
|
|
|
52703
52769
|
ctx.command("voidtrader", "虚空商人").alias("虚空商人").alias("奸商").action(voidtraderCommand);
|
|
52704
52770
|
ctx.command("lichc", "c系玄骸武器", { hidden: true }).action(inDevelopment);
|
|
52705
52771
|
ctx.command("lichi", "i系玄骸武器", { hidden: true }).action(inDevelopment);
|
|
52772
|
+
ctx.command("hotriven", "热门紫卡").action(hotRivenCommand);
|
|
52706
52773
|
}, "setupCommands");
|
|
52707
52774
|
var inDevelopment = /* @__PURE__ */ __name(() => {
|
|
52708
52775
|
return "功能暂未开放";
|