From 1541e7d1ec02a6e6ee9a05f2627230295be83a73 Mon Sep 17 00:00:00 2001 From: a-sync Date: Tue, 17 Sep 2024 11:49:46 +0200 Subject: [PATCH] check frags player field when score is not set --- src/discord-bot.ts | 1 + src/slack-bot.ts | 1 + src/telegram-bot.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/src/discord-bot.ts b/src/discord-bot.ts index 07a0adb..5fc20f7 100644 --- a/src/discord-bot.ts +++ b/src/discord-bot.ts @@ -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'); } diff --git a/src/slack-bot.ts b/src/slack-bot.ts index c7b0d20..b6e347a 100644 --- a/src/slack-bot.ts +++ b/src/slack-bot.ts @@ -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(' ')); } diff --git a/src/telegram-bot.ts b/src/telegram-bot.ts index 0919975..081a307 100644 --- a/src/telegram-bot.ts +++ b/src/telegram-bot.ts @@ -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); }