diff --git a/src/commands/rating.tsx b/src/commands/rating.tsx index ce5b919b5..885baa713 100644 --- a/src/commands/rating.tsx +++ b/src/commands/rating.tsx @@ -85,7 +85,15 @@ export const ratingCommand = new Promise((resolve) => { const statsA = leaderboard ? leaderboard.entries[statsIndex!] : null; const positionA = leaderboard ? statsIndex! + 1 : undefined; const statsB1 = accountInfo.statistics.rating!; - const [statsB2] = (await getRatingNeighbors(region, id, 0)).neighbors; + const statsB2Array = (await getRatingNeighbors(region, id, 0)).neighbors; + + if (statsB2Array === undefined) { + return translate('bot.commands.rating.errors.no_participation', [ + markdownEscape(accountInfo.nickname), + ]); + } + + const [statsB2] = statsB2Array; const league = getLeagueFromScore(statsB2.score); if (!statsA) {