Compare commits
2 Commits
c4f448ea12
...
5336070245
Author | SHA1 | Date |
---|---|---|
|
5336070245 | |
|
114555be66 |
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bhttp": "^1.2.8",
|
"bhttp": "^1.2.8",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"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": {
|
||||||
|
|
|
@ -116,9 +116,8 @@ function onRooms({ rooms, users }, bot) {
|
||||||
|
|
||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
function onJoin(data, bot) {
|
function onJoin(data, bot) {
|
||||||
bot.users[data.user.id] = data.user;
|
if (bot.rooms[data.roomId] && !bot.rooms[data.roomId]?.includes(data.user.id)) {
|
||||||
|
bot.users[data.user.id] = data.user;
|
||||||
if (!bot.rooms[data.roomId].includes(data.user.id)) {
|
|
||||||
bot.rooms[data.roomId].push(data.user.id);
|
bot.rooms[data.roomId].push(data.user.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ async function playRound(context, round = 0) {
|
||||||
const scores = scoreRound(context, round);
|
const scores = scoreRound(context, round);
|
||||||
|
|
||||||
if (game.mode === 'first') {
|
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') {
|
if (game.mode === 'timeout') {
|
||||||
|
|
Loading…
Reference in New Issue