const util = require("../util.js"); const commands = [{ pattern: "help", action: msg => { let isAuthed = util.isAuthorised(msg.member); let baseCommands = "\n"; let modCommands = "\n"; for(let command in util.documentation) { if(!util.documentation.hasOwnProperty(command)) continue; let doc = util.documentation[command]; if(isAuthed && doc.auth) modCommands = `${modCommands}${command} - ${doc.description}\n`; else if(!doc.auth) baseCommands = `${baseCommands}${command} - ${doc.description}\n`; } let message = `Hello! I am NoctBot! My job is to help with C(O)M-related problems!\nPing me with one of the following commands:\n\`\`\`${baseCommands}\`\`\``; if(isAuthed) message = `${msg.author.toString()} ${message}\nšŸ‘‘**Moderator commands**šŸ‘‘\n\`\`\`${modCommands}\`\`\``; msg.channel.send(message); } }]; module.exports = { commands: commands };