mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: replace $
This commit is contained in:
1 parent
98724df711
commit
f9f7468544
17 files changed
+182
-175
No files matched your search
@@ -9,7 +9,7 @@ export function addClanChoices(option: SlashCommandStringOption) {
|
||||
.setName('clan')
|
||||
.setNameLocalizations(
|
||||
localizationObject(
|
||||
(strings) => strings.bot.common.options.clan.$,
|
||||
(strings) => strings.bot.common.options.clan.name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
|
||||
@@ -23,10 +23,10 @@ export function addFilterOptions<
|
||||
option
|
||||
.addStringOption((option) =>
|
||||
option
|
||||
.setName(strings.bot.common.options.filters.nation.$)
|
||||
.setName(strings.bot.common.options.filters.nation.name)
|
||||
.setNameLocalizations(
|
||||
localizationObject(
|
||||
(strings) => strings.bot.common.options.filters.nation.$,
|
||||
(strings) => strings.bot.common.options.filters.nation.name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
@@ -60,10 +60,10 @@ export function addFilterOptions<
|
||||
.addStringOption((option) => addTierChoices(option).setRequired(false))
|
||||
.addStringOption((option) =>
|
||||
option
|
||||
.setName(strings.bot.common.options.filters.class.$)
|
||||
.setName(strings.bot.common.options.filters.class.name)
|
||||
.setNameLocalizations(
|
||||
localizationObject(
|
||||
(strings) => strings.bot.common.options.filters.class.$,
|
||||
(strings) => strings.bot.common.options.filters.class.name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
@@ -90,10 +90,10 @@ export function addFilterOptions<
|
||||
)
|
||||
.addStringOption((option) =>
|
||||
option
|
||||
.setName(strings.bot.common.options.filters.type.$)
|
||||
.setName(strings.bot.common.options.filters.type.name)
|
||||
.setNameLocalizations(
|
||||
localizationObject(
|
||||
(strings) => strings.bot.common.options.filters.type.$,
|
||||
(strings) => strings.bot.common.options.filters.type.name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
|
||||
@@ -19,32 +19,32 @@ export function addPeriodSubCommands(
|
||||
const { strings } = translator(Locale.EnglishUS);
|
||||
const subcommandNameLocalizations = {
|
||||
today: localizationObject(
|
||||
(strings) => strings.bot.common.subcommands.today.$,
|
||||
(strings) => strings.bot.common.subcommands.today.name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
30: localizationObject(
|
||||
(strings) => strings.bot.common.subcommands[30].$,
|
||||
(strings) => strings.bot.common.subcommands[30].name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
60: localizationObject(
|
||||
(strings) => strings.bot.common.subcommands[60].$,
|
||||
(strings) => strings.bot.common.subcommands[60].name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
90: localizationObject(
|
||||
(strings) => strings.bot.common.subcommands[90].$,
|
||||
(strings) => strings.bot.common.subcommands[90].name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
career: localizationObject(
|
||||
(strings) => strings.bot.common.subcommands.career.$,
|
||||
(strings) => strings.bot.common.subcommands.career.name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
custom: localizationObject(
|
||||
(strings) => strings.bot.common.subcommands.custom.$,
|
||||
(strings) => strings.bot.common.subcommands.custom.name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
@@ -74,7 +74,7 @@ export function addPeriodSubCommands(
|
||||
.addSubcommand((option) =>
|
||||
extra(
|
||||
option
|
||||
.setName(strings.bot.common.subcommands.today.$)
|
||||
.setName(strings.bot.common.subcommands.today.name)
|
||||
.setNameLocalizations(subcommandNameLocalizations.today)
|
||||
.setDescription(strings.bot.common.subcommands.today.description)
|
||||
.setDescriptionLocalizations(
|
||||
@@ -85,7 +85,7 @@ export function addPeriodSubCommands(
|
||||
.addSubcommand((option) =>
|
||||
extra(
|
||||
option
|
||||
.setName(strings.bot.common.subcommands[30].$)
|
||||
.setName(strings.bot.common.subcommands[30].name)
|
||||
.setNameLocalizations(subcommandNameLocalizations[30])
|
||||
.setDescription(strings.bot.common.subcommands[30].description)
|
||||
.setDescriptionLocalizations(subcommandDescriptionLocalizations[30]),
|
||||
@@ -94,7 +94,7 @@ export function addPeriodSubCommands(
|
||||
.addSubcommand((option) =>
|
||||
extra(
|
||||
option
|
||||
.setName(strings.bot.common.subcommands[60].$)
|
||||
.setName(strings.bot.common.subcommands[60].name)
|
||||
.setNameLocalizations(subcommandNameLocalizations[60])
|
||||
.setDescription(strings.bot.common.subcommands[60].description)
|
||||
.setDescriptionLocalizations(subcommandDescriptionLocalizations[60]),
|
||||
@@ -103,7 +103,7 @@ export function addPeriodSubCommands(
|
||||
.addSubcommand((option) =>
|
||||
extra(
|
||||
option
|
||||
.setName(strings.bot.common.subcommands[90].$)
|
||||
.setName(strings.bot.common.subcommands[90].name)
|
||||
.setNameLocalizations(subcommandNameLocalizations[90])
|
||||
.setDescription(strings.bot.common.subcommands[90].description)
|
||||
.setDescriptionLocalizations(subcommandDescriptionLocalizations[90]),
|
||||
@@ -112,7 +112,7 @@ export function addPeriodSubCommands(
|
||||
.addSubcommand((option) =>
|
||||
extra(
|
||||
option
|
||||
.setName(strings.bot.common.subcommands.career.$)
|
||||
.setName(strings.bot.common.subcommands.career.name)
|
||||
.setNameLocalizations(subcommandNameLocalizations.career)
|
||||
.setDescription(strings.bot.common.subcommands.career.description)
|
||||
.setDescriptionLocalizations(
|
||||
@@ -123,7 +123,7 @@ export function addPeriodSubCommands(
|
||||
.addSubcommand((option) =>
|
||||
extra(
|
||||
option
|
||||
.setName(strings.bot.common.subcommands.custom.$)
|
||||
.setName(strings.bot.common.subcommands.custom.name)
|
||||
.setNameLocalizations(subcommandNameLocalizations.custom)
|
||||
.setDescription(strings.bot.common.subcommands.custom.description)
|
||||
.setDescriptionLocalizations(
|
||||
@@ -131,7 +131,7 @@ export function addPeriodSubCommands(
|
||||
)
|
||||
.addIntegerOption((option) =>
|
||||
option
|
||||
.setName(strings.bot.common.subcommands.custom.options.start.$)
|
||||
.setName(strings.bot.common.subcommands.custom.options.start.name)
|
||||
.setDescription(
|
||||
strings.bot.common.subcommands.custom.options.start.description,
|
||||
)
|
||||
@@ -139,7 +139,7 @@ export function addPeriodSubCommands(
|
||||
)
|
||||
.addIntegerOption((option) =>
|
||||
option
|
||||
.setName(strings.bot.common.subcommands.custom.options.end.$)
|
||||
.setName(strings.bot.common.subcommands.custom.options.end.name)
|
||||
.setDescription(
|
||||
strings.bot.common.subcommands.custom.options.end.description,
|
||||
)
|
||||
|
||||
@@ -11,10 +11,10 @@ export function addRegionChoices(option: SlashCommandStringOption) {
|
||||
const { strings } = translator(Locale.EnglishUS);
|
||||
|
||||
return option
|
||||
.setName(strings.bot.common.options.region.$)
|
||||
.setName(strings.bot.common.options.region.name)
|
||||
.setNameLocalizations(
|
||||
localizationObject(
|
||||
(strings) => strings.bot.common.options.region.$,
|
||||
(strings) => strings.bot.common.options.region.name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
|
||||
@@ -6,10 +6,10 @@ export function addTankChoices(option: SlashCommandStringOption) {
|
||||
const { strings } = translator(Locale.EnglishUS);
|
||||
|
||||
return option
|
||||
.setName(strings.bot.common.options.tank.$)
|
||||
.setName(strings.bot.common.options.tank.name)
|
||||
.setNameLocalizations(
|
||||
localizationObject(
|
||||
(strings) => strings.bot.common.options.tank.$,
|
||||
(strings) => strings.bot.common.options.tank.name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
|
||||
@@ -13,10 +13,10 @@ export function addTierChoices(option: SlashCommandStringOption) {
|
||||
const { strings } = translator(Locale.EnglishUS);
|
||||
|
||||
return option
|
||||
.setName(strings.bot.common.options.tier.$)
|
||||
.setName(strings.bot.common.options.tier.name)
|
||||
.setNameLocalizations(
|
||||
localizationObject(
|
||||
(strings) => strings.bot.common.options.tier.$,
|
||||
(strings) => strings.bot.common.options.tier.name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
|
||||
@@ -6,10 +6,10 @@ export function addUsernameChoices(option: SlashCommandStringOption) {
|
||||
const { strings } = translator(Locale.EnglishUS);
|
||||
|
||||
return option
|
||||
.setName(strings.bot.common.options.username.$)
|
||||
.setName(strings.bot.common.options.username.name)
|
||||
.setNameLocalizations(
|
||||
localizationObject(
|
||||
(strings) => strings.bot.common.options.username.$,
|
||||
(strings) => strings.bot.common.options.username.name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
|
||||
@@ -35,8 +35,8 @@ export async function autocompleteTanks(
|
||||
{
|
||||
keys: [
|
||||
...SUPPORTED_LOCALES.map((locale) => [
|
||||
`searchableName.${locale}`,
|
||||
`searchableNameDeburr.${locale}`,
|
||||
`searchableName.{locale}`,
|
||||
`searchableNameDeburr.{locale}`,
|
||||
]).flat(),
|
||||
'camouflages',
|
||||
],
|
||||
|
||||
@@ -33,7 +33,7 @@ export function createLocalizedCommand(
|
||||
.setName(command)
|
||||
.setNameLocalizations(
|
||||
localizationObject(
|
||||
(strings) => strings.bot.commands[commandPathItem].$,
|
||||
(strings) => strings.bot.commands[commandPathItem].name,
|
||||
undefined,
|
||||
true,
|
||||
),
|
||||
@@ -52,9 +52,9 @@ export function createLocalizedCommand(
|
||||
(strings) =>
|
||||
(
|
||||
strings.bot.commands[commandPathItem] as unknown as {
|
||||
subcommands: Record<string, { $: string }>;
|
||||
subcommands: Record<string, { name: string }>;
|
||||
}
|
||||
).subcommands[subItem.subcommand].$,
|
||||
).subcommands[subItem.subcommand].name,
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
@@ -87,9 +87,9 @@ export function createLocalizedCommand(
|
||||
(strings) =>
|
||||
(
|
||||
strings.bot.commands[commandPathItem] as unknown as {
|
||||
groups: Record<string, { $: string }>;
|
||||
groups: Record<string, { name: string }>;
|
||||
}
|
||||
).groups[subItem.group].$,
|
||||
).groups[subItem.group].name,
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user