feat: rename tank types to tank classes

This commit is contained in:
TrèsAbhi committed 2024-03-07 18:30:02 -06:00
1 parent 3325536bbc
commit 53174db351
18 files changed
+53 -64

No files matched your search

+8 -8
View File
@@ -4,7 +4,7 @@ import {
SlashCommandBuilder,
SlashCommandSubcommandBuilder,
} from 'discord.js';
import { TANK_TYPES, TREE_TYPES } from '../../components/Tanks';
import { TANK_CLASSES, TREE_TYPES } from '../../components/Tanks';
import { translator } from '../localization/translator';
import addTankChoices from './addTankChoices';
import addTierChoices from './addTierChoices';
@@ -46,26 +46,26 @@ export function addFilterOptions<
.addStringOption((option) => addTierChoices(option).setRequired(false))
.addStringOption((option) =>
option
.setName(translate('bot.common.options.filters.tank_type'))
.setName(translate('bot.common.options.filters.tank_class'))
.setNameLocalizations(
localizationObject('bot.common.options.filters.tank_type'),
localizationObject('bot.common.options.filters.tank_class'),
)
.setDescription(
translate('bot.common.options.filters.tank_type.description'),
translate('bot.common.options.filters.tank_class.description'),
)
.setDescriptionLocalizations(
localizationObject(
'bot.common.options.filters.tank_type.description',
'bot.common.options.filters.tank_class.description',
),
)
.addChoices(
...TANK_TYPES.map(
...TANK_CLASSES.map(
(tankType) =>
({
value: tankType,
name: translate(`common.tank_type_short.${tankType}`),
name: translate(`common.tank_class_short.${tankType}`),
name_localizations: localizationObject(
`common.tank_type_short.${tankType}`,
`common.tank_class_short.${tankType}`,
),
}) satisfies APIApplicationCommandOptionChoice,
),
+1 -1
View File
@@ -8,7 +8,7 @@ export function getFiltersFromButton(interaction: ButtonInteraction) {
return {
nation: url.searchParams.get('nation') ?? undefined,
tank: parseInt(url.searchParams.get('tank') ?? '0') || undefined,
tankType: url.searchParams.get('tank-type') ?? undefined,
tankType: url.searchParams.get('tank-class') ?? undefined,
treeType:
(url.searchParams.get('tree-type') as TreeType | undefined) ?? undefined,
tier: parseInt(url.searchParams.get('tier') ?? '0') || undefined,
+1 -1
View File
@@ -11,7 +11,7 @@ export async function getFiltersFromCommand(
return {
nation: interaction.options.getString('nation') ?? undefined,
tier: parseInt(interaction.options.getString('tier') ?? '0') || undefined,
tankType: interaction.options.getString('tank-type') ?? undefined,
tankType: interaction.options.getString('tank-class') ?? undefined,
treeType:
(interaction.options.getString('tree-type') as TreeType | undefined) ??
undefined,