Added settings interface to trivia game.
This commit is contained in:
parent
1ca03c3faa
commit
0a1512e639
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue