123456789101112131415161718192021222324252627282930313233 |
- 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
- };
|