mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: BlitzServer type
This commit is contained in:
1 parent
6870b59b3b
commit
8b77baccab
6 files changed
+27
-33
No files matched your search
@@ -5,16 +5,16 @@ import {
|
||||
} from 'discord.js';
|
||||
import fetch from 'node-fetch';
|
||||
import { NEGATIVE_COLOR } from '../constants/colors.js';
|
||||
import { SERVERS } from '../constants/servers.js';
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
||||
import { Player, Players } from '../types/players.js';
|
||||
|
||||
export default async function getBlitzAccount(
|
||||
interaction: ChatInputCommandInteraction<CacheType>,
|
||||
ign: string,
|
||||
server: keyof typeof SERVERS,
|
||||
server: BlitzServer,
|
||||
callback: (account: Player) => void,
|
||||
) {
|
||||
const serverName = SERVERS[server];
|
||||
const serverName = BLITZ_SERVERS[server];
|
||||
const players = (await fetch(
|
||||
`https://api.wotblitz.${server}/wotb/account/list/?application_id=${process.env.WARGAMING_APPLICATION_ID}&search=${ign}`,
|
||||
).then((response) => response.json())) as Players;
|
||||
|
||||
Reference in new issue
Block a user