Stripping off @-prefix from points username.

This commit is contained in:
ThePendulum 2021-11-16 00:40:02 +01:00
parent 56d8bd34be
commit 9c5bcbdd22
1 changed files with 2 additions and 1 deletions

View File

@ -72,7 +72,8 @@ async function setPoints(defaultKey, user, value, { mode = 'add', key } = {}) {
await fs.writeFile(`./points-${instance}.json`, JSON.stringify(points, null, 4)); 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 gamePoints = points[command] || points[game.key];
const userPoints = username const userPoints = username