Skip to content

Commit

Permalink
check frags player field when score is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sync committed Sep 17, 2024
1 parent a55912c commit 1541e7d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/discord-bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ class ServerInfoMessage {
if (p.get('name') !== undefined) pNames.push(p.get('name') || 'n/a');
if (p.get('time') !== undefined) pTimes.push(hhmmss(p.get('time') || 0));
if (p.get('score') !== undefined) pScores.push(p.get('score') || '0');
else if (p.get('frags') !== undefined) pScores.push(p.get('frags') || '0');
if (p.get('ping') !== undefined) pPings.push(String(p.get('ping') || 0) + ' ms');
}

Expand Down
1 change: 1 addition & 0 deletions src/slack-bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ class ServerInfoMessage {
if (p.get('time') !== undefined) line.push(hhmmss(p.get('time') || 0));
if (p.get('name') !== undefined) line.push(p.get('name') || 'n/a');
if (p.get('score') !== undefined) line.push('(' + (p.get('score') || '0') + ')');
else if (p.get('frags') !== undefined) line.push('(' + (p.get('frags') || '0') + ')');

pNames.push(line.join(' '));
}
Expand Down
1 change: 1 addition & 0 deletions src/telegram-bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class ServerInfoMessage {
if (p.get('time') !== undefined) playerLine += hhmmss(p.get('time') || '0') + ' ';
if (p.get('name') !== undefined) playerLine += p.get('name') || 'n/a';
if (p.get('score') !== undefined) playerLine += ' (' + (p.get('score') || 0) + ')';
else if (p.get('frags') !== undefined) playerLine += ' (' + (p.get('frags') || 0) + ')';
pnArr.push(playerLine);
}

Expand Down

0 comments on commit 1541e7d

Please sign in to comment.