Files
blitzkit/packages/bot/src/core/blitzstars/getBlitzStarsLinkButton.ts
T

17 lines
429 B
TypeScript
Raw Normal View History

2025-10-13 23:20:26 -05:00
import { getAccountInfo, type Region } from "@blitzkit/core";
import { buttonLink } from "../discord/buttonLink";
2023-10-11 18:26:35 -05:00
2023-10-12 12:07:45 -05:00
export async function getBlitzStarsLinkButton(
region: Region,
id: number,
2025-10-13 23:20:26 -05:00
tankId?: number
2023-10-12 12:07:45 -05:00
) {
2023-10-14 10:52:05 -05:00
const { nickname } = await getAccountInfo(region, id);
2023-10-11 18:26:35 -05:00
2023-10-14 11:36:10 -05:00
return buttonLink(
2023-10-12 12:07:45 -05:00
`https://www.blitzstars.com/player/${region}/${nickname}${
2025-10-13 23:20:26 -05:00
tankId ? `/tank/${tankId!}` : ""
2023-10-12 12:07:45 -05:00
}`,
2025-10-13 23:20:26 -05:00
"BlitzStars"
2023-10-11 18:26:35 -05:00
);
}