From 9c5bcbdd22b3a6ebd6b9ce200f649d429e514f4f Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Tue, 16 Nov 2021 00:40:02 +0100 Subject: [PATCH] Stripping off @-prefix from points username. --- src/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index 83407e1..406508d 100644 --- a/src/app.js +++ b/src/app.js @@ -72,7 +72,8 @@ async function setPoints(defaultKey, user, value, { mode = 'add', key } = {}) { await fs.writeFile(`./points-${instance}.json`, JSON.stringify(points, null, 4)); } -function getPoints(game, username, { user, room, command }) { +function getPoints(game, rawUsername, { user, room, command }) { + const username = rawUsername?.replace(/^@/, ''); const gamePoints = points[command] || points[game.key]; const userPoints = username