feat: replace $

This commit is contained in:
tresabhi committed 2025-01-16 14:22:30 -06:00
1 parent 98724df711
commit f9f7468544
17 files changed
+182 -175

No files matched your search

+4 -4
View File
@@ -10,11 +10,11 @@ import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
import { translator } from '../core/localization/translator';
import { CommandRegistry } from '../events/interactionCreate';
interface Auction {
type Auction = null | {
count: number;
has_next: boolean;
results: Result[];
}
};
type Result =
| {
@@ -88,12 +88,12 @@ export const auctionCommand = new Promise<CommandRegistry>((resolve) => {
pageSize
}&type[]=vehicle&saleable=${saleable}`,
).then((response) => response.json() as Promise<Auction>);
const saleableTanks = data.results.filter((result) => result.available);
if (saleableTanks.length === 0) {
if (data === null) {
return strings.bot.commands.auction.errors.no_auction;
}
const saleableTanks = data.results.filter((result) => result.available);
const nextPricesTimestamp = saleableTanks[0].next_price_timestamp;
const title = `# ${strings.bot.commands.auction.body.title}`;
+1 -1
View File
@@ -26,7 +26,7 @@ export const inactiveCommand = new Promise<CommandRegistry>((resolve) => {
.setName('threshold')
.setNameLocalizations(
localizationObject(
(strings) => strings.bot.commands.inactive.options.threshold.$,
(strings) => strings.bot.commands.inactive.options.threshold.name,
undefined,
true,
),
@@ -60,11 +60,11 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
return option
.addIntegerOption((option) =>
option
.setName(strings.bot.commands.rating_leaderboard.options.limit.$)
.setName(strings.bot.commands.rating_leaderboard.options.limit.name)
.setNameLocalizations(
localizationObject(
(strings) =>
strings.bot.commands.rating_leaderboard.options.limit.$,
strings.bot.commands.rating_leaderboard.options.limit.name,
undefined,
true,
),
@@ -90,11 +90,13 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
)
.addStringOption((option) =>
option
.setName(strings.bot.commands.rating_leaderboard.options.season.$)
.setName(
strings.bot.commands.rating_leaderboard.options.season.name,
)
.setNameLocalizations(
localizationObject(
(strings) =>
strings.bot.commands.rating_leaderboard.options.season.$,
strings.bot.commands.rating_leaderboard.options.season.name,
undefined,
true,
),
@@ -159,13 +161,13 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
return option
.setName(
strings.bot.commands.rating_leaderboard.options.league.$,
strings.bot.commands.rating_leaderboard.options.league.name,
)
.setNameLocalizations(
localizationObject(
(strings) =>
strings.bot.commands.rating_leaderboard.options.league
.$,
.name,
undefined,
true,
),
+5 -4
View File
@@ -35,10 +35,11 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
command: createLocalizedCommand('research')
.addStringOption((option) =>
option
.setName(strings.bot.commands.research.options.target_tank.$)
.setName(strings.bot.commands.research.options.target_tank.name)
.setNameLocalizations(
localizationObject(
(strings) => strings.bot.commands.research.options.target_tank.$,
(strings) =>
strings.bot.commands.research.options.target_tank.name,
undefined,
true,
),
@@ -57,11 +58,11 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
)
.addStringOption((option) =>
option
.setName(strings.bot.commands.research.options.starting_tank.$)
.setName(strings.bot.commands.research.options.starting_tank.name)
.setNameLocalizations(
localizationObject(
(strings) =>
strings.bot.commands.research.options.starting_tank.$,
strings.bot.commands.research.options.starting_tank.name,
undefined,
true,
),
+2 -2
View File
@@ -23,10 +23,10 @@ export const searchClansCommand = new Promise<CommandRegistry>((resolve) => {
const { strings } = translator(Locale.EnglishUS);
return option
.setName(strings.bot.commands.search_clans.options.limit.$)
.setName(strings.bot.commands.search_clans.options.limit.name)
.setNameLocalizations(
localizationObject(
(strings) => strings.bot.commands.search_clans.options.limit.$,
(strings) => strings.bot.commands.search_clans.options.limit.name,
undefined,
true,
),
+3 -2
View File
@@ -28,10 +28,11 @@ export const searchPlayersCommand = new Promise<CommandRegistry>((resolve) => {
)
.addIntegerOption((option) =>
option
.setName(strings.bot.commands.search_players.options.limit.$)
.setName(strings.bot.commands.search_players.options.limit.name)
.setNameLocalizations(
localizationObject(
(strings) => strings.bot.commands.search_players.options.limit.$,
(strings) =>
strings.bot.commands.search_players.options.limit.name,
undefined,
true,
),