1234567891011121314151617181920212223242526272829303132 |
- const util = require("../util.js");
- const commands = {
- "help": 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
- };
|