From 2ace996ec7ed8c7faceca8fa5b11d9099629c38c Mon Sep 17 00:00:00 2001 From: Max Litruv Boonzaayer Date: Thu, 4 Apr 2019 23:28:58 +1100 Subject: [PATCH] permissions, category set --- commands/help.js | 10 ++++++---- index.js | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/commands/help.js b/commands/help.js index 9cb9e45..50acddf 100644 --- a/commands/help.js +++ b/commands/help.js @@ -6,6 +6,7 @@ module.exports = { alias: ['help', '?'], helptext: "Runs this help menu", permissions: ['VIEW_CHANNEL'], + category: 'general', args: ['(general)/music/admin'], command: (client, msg) => { fs.readdir("./commands/", function (err, items) { @@ -61,10 +62,11 @@ module.exports = { } description += "```apache\n" for (var z = 0; z < reqcommand.alias.length; z++) { - description += client.cachedserversettings.filter(function (server) { - return server.guildID == msg.guild.id; - })[0].prefix - + if (msg.channel.type != "dm") { + description += client.cachedserversettings.filter(function (server) { + return server.guildID == msg.guild.id; + })[0].prefix + } description += reqcommand.alias[z] + " "; if (z != reqcommand.alias.length - 1) description += "/ "; diff --git a/index.js b/index.js index 3278278..e562d08 100644 --- a/index.js +++ b/index.js @@ -92,7 +92,7 @@ client.on("message", (msg) => { }) function onMessage(msg, again = true) { - if (msg.channel.type = "dm") { + if (msg.channel.type == "dm") { doPMCommand(msg, "") } else { @@ -125,7 +125,7 @@ function doPMCommand(msg, prefix) { if (cmds.length > 0) { console.log("CMD:".green + " ".reset + msg.author.username.bold + "#".reset + msg.author.discriminator.reset + " " + prefix.grey + command.green.bold + " ".reset + msg.suffix + " | PM") var reqcommand = require('./commands/' + cmds[0].file) - if (reqcommand.permissions == 'READ_MESSAGES') { + if (reqcommand.category == 'general') { msg.react('✅') try { reqcommand.command(client, msg)