diff --git a/commands/cloop.js b/commands/cloop.js index ef35b0c..ed0bbe7 100644 --- a/commands/cloop.js +++ b/commands/cloop.js @@ -1,7 +1,8 @@ const { getMessage } = require('../util/lang.js') module.exports = { execute: (c) => { - const subcmd = c.args.splice(0, 1)[0] + let subcmd; + if(c.args.length>=1) subcmd = c.args.splice(0, 1)[0].toLowerCase(); switch (subcmd) { case 'add': { const rate = +(c.args.splice(0, 1)[0]) diff --git a/commands/help.js b/commands/help.js index 31c0547..ce56004 100644 --- a/commands/help.js +++ b/commands/help.js @@ -65,7 +65,8 @@ const printHelp = (c) => { } const printCmdHelp = (c) => { - const cmd = c.args[0] + let cmd; + if(c.args.length>=1) cmd = c.args[0].toLowerCase(); if (!cmds[cmd] || (cmds[cmd].hidden && c.type !== 'console')) { c.reply({ text: getMessage(c.lang, 'command.help.noCommand') }) return diff --git a/commands/settings.js b/commands/settings.js index 2138edd..54a1e3a 100644 --- a/commands/settings.js +++ b/commands/settings.js @@ -17,7 +17,8 @@ module.exports = { }) return } - const subcmd = c.args.splice(0, 1)[0] + let subcmd; + if(c.args.length>=1) subcmd = c.args.splice(0, 1)[0].toLowerCase(); switch (subcmd) { case 'set':{ const allowedKeys = ['colorPrimary', 'colorSecondary', 'lang']