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", "name": "schat2-clive",
"version": "1.4.7", "version": "1.4.8",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "schat2-clive", "name": "schat2-clive",
"version": "1.4.7", "version": "1.4.8",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"bhttp": "^1.2.8", "bhttp": "^1.2.8",

View File

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

View File

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