Stripping off @-prefix from points username.
This commit is contained in:
parent
56d8bd34be
commit
9c5bcbdd22
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue