mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: data driven nations
This commit is contained in:
1 parent
7e5357dfe7
commit
7225fb0231
6 files changed
+40
-35
No files matched your search
@@ -197,18 +197,6 @@ export const tankNames = tanksDefinitionsArray.then((tanks) =>
|
||||
|
||||
export type Tier = (typeof TIERS)[number];
|
||||
|
||||
// TODO: DEPRICATE THISuuu
|
||||
export const NATIONS = tanksDefinitionsArray.then((tanks) => {
|
||||
const nations = Array.from(
|
||||
new Set<string>(Object.values(tanks).map((tank) => tank.nation)),
|
||||
);
|
||||
|
||||
nations.splice(nations.indexOf('other'), 1);
|
||||
nations.push('other');
|
||||
|
||||
return nations;
|
||||
});
|
||||
|
||||
export const flags: Record<string, string> = {
|
||||
ussr: '<:ussr:1218421042033197197>',
|
||||
germany: '🇩🇪',
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
SlashCommandSubcommandBuilder,
|
||||
SlashCommandSubcommandGroupBuilder,
|
||||
} from 'discord.js';
|
||||
import { NATIONS } from '../blitzkit/tankDefinitions';
|
||||
import { gameDefinitions } from '../blitzkit/gameDefinitions';
|
||||
import { addFilterOptions } from './addFilterOptions';
|
||||
import { addPeriodSubCommands } from './addPeriodSubCommands';
|
||||
|
||||
@@ -15,9 +15,10 @@ export default async function addPeriodicFilterOptions<
|
||||
option: SlashCommandSubcommandBuilder,
|
||||
) => SlashCommandSubcommandBuilder = (option) => option,
|
||||
): Promise<OptionType> {
|
||||
const nations = await NATIONS;
|
||||
const awaitedGameDefinitions = await gameDefinitions;
|
||||
|
||||
addPeriodSubCommands(option, (option) =>
|
||||
addFilterOptions(extra(option), nations),
|
||||
addFilterOptions(extra(option), awaitedGameDefinitions.nations),
|
||||
);
|
||||
|
||||
return option;
|
||||
|
||||
Reference in new issue
Block a user