Compare commits

...

2 Commits

Author SHA1 Message Date
ThePendulum ab06712497 1.4.7 2021-11-09 13:48:33 +01:00
ThePendulum 0a1512e639 Added settings interface to trivia game. 2021-11-09 13:48:21 +01:00
3 changed files with 11 additions and 3 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "schat2-clive", "name": "schat2-clive",
"version": "1.4.6", "version": "1.4.7",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "schat2-clive", "name": "schat2-clive",
"version": "1.4.6", "version": "1.4.7",
"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.6", "version": "1.4.7",
"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

@ -148,6 +148,14 @@ function onCommand(args, context) {
if (context.subcommand === 'stop' && !game) { if (context.subcommand === 'stop' && !game) {
context.sendMessage(`There is no game going on at the moment. Start one with ${config.prefix}trivia!`, context.room.id); context.sendMessage(`There is no game going on at the moment. Start one with ${config.prefix}trivia!`, context.room.id);
} }
const subcommand = context.subcommand?.toLowerCase();
if (subcommand) {
settings[subcommand] = typeof settings[subcommand] === 'number' ? (Number(args[0]) || settings[subcommand]) : args[0];
context.sendMessage(`${subcommand} set to ${settings[subcommand]}`, context.room.id);
}
} }
async function onMessage(message, context) { async function onMessage(message, context) {