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

View File

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

View File

@ -148,6 +148,14 @@ function onCommand(args, context) {
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);
}
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) {