2023-10-11 18:26:35 -05:00
|
|
|
import { Region } from '../../constants/regions';
|
2023-10-14 11:25:42 -05:00
|
|
|
import { getAccountInfo } from '../blitz/getAccountInfo';
|
2023-10-14 11:36:10 -05:00
|
|
|
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,
|
|
|
|
|
tankId?: number,
|
|
|
|
|
) {
|
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}${
|
|
|
|
|
tankId ? `/tank/${tankId!}` : ''
|
|
|
|
|
}`,
|
2023-10-11 18:26:35 -05:00
|
|
|
'BlitzStars',
|
|
|
|
|
);
|
|
|
|
|
}
|