feat: better subcommand organiztion

This commit is contained in:
TresAbhi committed 2023-08-04 02:13:21 +00:00
1 parent 2cabcc57f4
commit 23dd088466
15 files changed
+749 -867

No files matched your search

+19
View File
@@ -1,3 +1,6 @@
import { secrets } from '../node/secrets';
import getWargamingResponse from './getWargamingResponse';
export interface TankopediaEntry {
name: string;
nation: string;
@@ -32,6 +35,22 @@ export const TANK_NAMES = new Promise<string[]>(async (resolve) => {
resolve((await entries).map(({ name }) => name));
});
export interface TankopediaInfo {
achievement_sections: Record<string, { name: string; order: number }>;
tanks_updated_at: number;
languages: Record<string, string>;
vehicle_types: Record<string, string>;
vehicle_nations: Record<string, string>;
game_version: string;
}
// this is blocking because info is needed for command creation
console.log('Caching tankopedia info...');
export const tankopediaInfo = getWargamingResponse<TankopediaInfo>(
`https://api.wotblitz.com/wotb/encyclopedia/info/?application_id=${secrets.WARGAMING_APPLICATION_ID}`,
);
console.log('Cached tankopedia info');
export const TANK_ICONS: Record<string, string> = {
'AT-SPG': 'https://i.imgur.com/BIHSEH0.png',
lightTank: 'https://i.imgur.com/CSNha5V.png',