Add support for /mode without arguments

This commit is contained in:
Simon Ser 2021-06-07 14:12:49 +02:00
parent 5b7ab2652b
commit dd753aab2e

View file

@ -179,11 +179,11 @@ export default {
}, },
}, },
"mode": { "mode": {
usage: "[target] <modes> [mode args...]", usage: "[target] [modes] [mode args...]",
description: "Change channel or user mode", description: "Query or change a channel or user mode",
execute: (app, args) => { execute: (app, args) => {
var target = args[0]; var target = args[0];
if (target.startsWith("+") || target.startsWith("-")) { if (!target || target.startsWith("+") || target.startsWith("-")) {
var activeChannel = getActiveChannel(app); var activeChannel = getActiveChannel(app);
args = [activeChannel, ...args]; args = [activeChannel, ...args];
} }