mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
fix: max 25 seasons
This commit is contained in:
1 parent
e159583333
commit
de77e27d50
2 files changed
+12
-9
No files matched your search
@@ -52,7 +52,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
const seasonNumbers = range(
|
||||
FIRST_MINIMAL_ARCHIVED_RATING_SEASON,
|
||||
latestArchivedSeasonNumber + (onGoingSeason ? 1 : 0) + 1
|
||||
);
|
||||
).slice(-25);
|
||||
|
||||
function addOptions(option: SlashCommandSubcommandBuilder) {
|
||||
const { strings } = translator(Locale.EnglishUS);
|
||||
@@ -196,7 +196,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
strings.common.leagues as Record<string, string>
|
||||
)[name]
|
||||
),
|
||||
}) satisfies APIApplicationCommandOptionChoice<string>
|
||||
} satisfies APIApplicationCommandOptionChoice<string>)
|
||||
)
|
||||
)
|
||||
.setRequired(true);
|
||||
@@ -219,8 +219,8 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
const season = seasonOption
|
||||
? parseInt(seasonOption)
|
||||
: onGoingSeason
|
||||
? latestArchivedSeasonNumber + 1
|
||||
: latestArchivedSeasonNumber;
|
||||
? latestArchivedSeasonNumber + 1
|
||||
: latestArchivedSeasonNumber;
|
||||
const isCurrentSeason = season === latestArchivedSeasonNumber + 1;
|
||||
let titleName: string;
|
||||
let titleImage: string | undefined;
|
||||
@@ -258,7 +258,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
position: player.number,
|
||||
clan: player.clan_tag,
|
||||
nickname: player.nickname,
|
||||
}) satisfies SimplifiedPlayer
|
||||
} satisfies SimplifiedPlayer)
|
||||
)
|
||||
)
|
||||
: await getArchivedRatingLeaderboard(region, season!).then(
|
||||
@@ -295,7 +295,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
.deleted_player,
|
||||
{ id: player.id }
|
||||
),
|
||||
}) satisfies SimplifiedPlayer
|
||||
} satisfies SimplifiedPlayer)
|
||||
);
|
||||
}
|
||||
);
|
||||
@@ -349,7 +349,7 @@ export const ratingLeaderboardCommand = new Promise<CommandRegistry>(
|
||||
score: player.score,
|
||||
clan: player.clan_tag,
|
||||
nickname: player.nickname,
|
||||
}) satisfies SimplifiedPlayer
|
||||
} satisfies SimplifiedPlayer)
|
||||
)
|
||||
)
|
||||
: await getArchivedRatingLeaderboard(region, season!).then(
|
||||
|
||||
@@ -2,12 +2,15 @@ import { build } from "esbuild";
|
||||
import { cp, readdir, rm } from "fs/promises";
|
||||
import { argv } from "process";
|
||||
|
||||
const dev = argv.includes("--dev");
|
||||
|
||||
const projectDir = "../..";
|
||||
const srcRoot = `${projectDir}/packages/bot`;
|
||||
const distRoot = `${projectDir}/dist/bot`;
|
||||
const modulesRoot = "../../node_modules";
|
||||
const modulesRoot = dev
|
||||
? "../../packages/bot/node_modules"
|
||||
: "../../node_modules";
|
||||
const workers = await readdir(`${srcRoot}/src/workers`);
|
||||
const dev = argv.includes("--dev");
|
||||
|
||||
await rm(distRoot, { recursive: true, force: true });
|
||||
|
||||
|
||||
Reference in new issue
Block a user