diff --git a/commands/custom.js b/commands/custom.js index 35e0434..a56e496 100644 --- a/commands/custom.js +++ b/commands/custom.js @@ -11,6 +11,7 @@ module.exports = { description: 'Add custom commands, see help custom for more', moreHelp: ["custom add - Add new custom commands", "custom edit - Edit an existing command that you own", + "custom show - Show custom message unformatted.", "custom remove - Delete your custom commands.", "custom owner - check owner of custom command", "custom list - list all custom commands", @@ -63,6 +64,17 @@ module.exports = { case "edit": sendText = editCustomCommand(customName, message.author.id, customMessage) break; + case "show": + let json = fs.readFileSync(customPath, 'utf8'); + let customCommands = JSON.parse(json) + customCommands.forEach(function (customCommand) { + if (customCommand.customName === args[1]) { + sendText = `\`\`\`\n${customCommand.customMessage}\n\`\`\`` + }else{ + sendText = "Command not found." + } + }); + break; default: sendText = `Argument not recognized.\n"${prefix}help custom" to see all arguments you can use.` break;