diff --git a/src/app.js b/src/app.js index 1b657fd..f1a18b5 100644 --- a/src/app.js +++ b/src/app.js @@ -116,9 +116,8 @@ function onRooms({ rooms, users }, bot) { /* eslint-disable no-param-reassign */ function onJoin(data, bot) { - bot.users[data.user.id] = data.user; - - if (!bot.rooms[data.roomId].includes(data.user.id)) { + if (bot.rooms[data.roomId] && !bot.rooms[data.roomId]?.includes(data.user.id)) { + bot.users[data.user.id] = data.user; bot.rooms[data.roomId].push(data.user.id); } } diff --git a/src/games/trivia.js b/src/games/trivia.js index dd022b6..54c515c 100644 --- a/src/games/trivia.js +++ b/src/games/trivia.js @@ -78,7 +78,7 @@ async function playRound(context, round = 0) { const scores = scoreRound(context, round); if (game.mode === 'first') { - context.sendMessage(`**${question.answer}** is the right answer after **${((new Date() - now) / 1000).toFixed(3)}s**! ${scores}`, context.room.id); + context.sendMessage(`**${question.answer}** is the right answer, played in **${((new Date() - now) / 1000).toFixed(3)}s**! ${scores}`, context.room.id); } if (game.mode === 'timeout') {