Fixed missing user breaking Trivia.

This commit is contained in:
ThePendulum 2021-11-09 14:51:37 +01:00
parent 0983d7e920
commit fa54000f1c
1 changed files with 8 additions and 4 deletions

View File

@ -29,11 +29,15 @@ function scoreRound(context, round) {
}
return game.answers.map(({ user }) => {
context.setPoints(user, 1);
game.points[user.username] = (game.points[user.username] || 0) + 1;
if (user) {
context.setPoints(user, 1);
game.points[user.username] = (game.points[user.username] || 0) + 1;
return `**@${user.username}** gets a point`;
}).join(', ');
return `**@${user.username}** gets a point`;
}
return null;
}).filter(Boolean).join(', ');
}
async function playRound(context, round = 0) {