Compare commits

...

2 Commits

Author SHA1 Message Date
ThePendulum f4df512031 1.4.8 2021-11-09 14:51:39 +01:00
ThePendulum fa54000f1c Fixed missing user breaking Trivia. 2021-11-09 14:51:37 +01:00
3 changed files with 11 additions and 7 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "schat2-clive",
"version": "1.4.7",
"version": "1.4.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "schat2-clive",
"version": "1.4.7",
"version": "1.4.8",
"license": "ISC",
"dependencies": {
"bhttp": "^1.2.8",

View File

@ -1,6 +1,6 @@
{
"name": "schat2-clive",
"version": "1.4.7",
"version": "1.4.8",
"description": "Game host for SChat 2-powered chat sites",
"main": "src/app.js",
"scripts": {

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) {