mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: rating command seasonal fix
This commit is contained in:
1 parent
e5c9c780e9
commit
721bfd9ea2
3 files changed
+73
-70
No files matched your search
@@ -42,9 +42,16 @@ export const ratingCommand = new Promise<CommandRegistry>((resolve) => {
|
||||
const { id, region } = await resolvePlayerFromCommand(interaction);
|
||||
const clan = (await getClanAccountInfo(region, id, ['clan']))?.clan;
|
||||
const clanImage = clan ? emblemURL(clan.emblem_set_id) : undefined;
|
||||
|
||||
const ratingInfo = await getRatingInfo(region);
|
||||
|
||||
if (ratingInfo.detail) {
|
||||
throw new Error(`Rating info not available for ${region}`);
|
||||
}
|
||||
|
||||
const leaderboard = await getArchivedRatingMidnightLeaderboard(
|
||||
region,
|
||||
53,
|
||||
ratingInfo.current_season,
|
||||
);
|
||||
|
||||
if (leaderboard?.format === BkrlFormat.Base) {
|
||||
@@ -53,7 +60,6 @@ export const ratingCommand = new Promise<CommandRegistry>((resolve) => {
|
||||
);
|
||||
}
|
||||
|
||||
const ratingInfo = await getRatingInfo(region);
|
||||
const accountInfo = await getAccountInfo(region, id, [
|
||||
'statistics.rating',
|
||||
]);
|
||||
@@ -66,9 +72,6 @@ export const ratingCommand = new Promise<CommandRegistry>((resolve) => {
|
||||
const [statsB2] = (await getRatingNeighbors(region, id, 0)).neighbors;
|
||||
const league = getLeagueFromScore(statsB2.score);
|
||||
|
||||
if (ratingInfo.detail) {
|
||||
throw new Error(`Rating info not available for ${region}`);
|
||||
}
|
||||
if (!statsA) {
|
||||
return t`bot.commands.rating.errors.unrecorded_stats`;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user