Add show feature to custom command
Show feature will show the custom message unformatted
This commit is contained in:
parent
c1bc55d456
commit
63f28e4575
1 changed files with 12 additions and 0 deletions
|
@ -11,6 +11,7 @@ module.exports = {
|
||||||
description: 'Add custom commands, see <prefix>help custom for more',
|
description: 'Add custom commands, see <prefix>help custom for more',
|
||||||
moreHelp: ["<prefix>custom add - Add new custom commands",
|
moreHelp: ["<prefix>custom add - Add new custom commands",
|
||||||
"<prefix>custom edit - Edit an existing command that you own",
|
"<prefix>custom edit - Edit an existing command that you own",
|
||||||
|
"<prefix>custom show - Show custom message unformatted.",
|
||||||
"<prefix>custom remove - Delete your custom commands.",
|
"<prefix>custom remove - Delete your custom commands.",
|
||||||
"<prefix>custom owner - check owner of custom command",
|
"<prefix>custom owner - check owner of custom command",
|
||||||
"<prefix>custom list - list all custom commands",
|
"<prefix>custom list - list all custom commands",
|
||||||
|
@ -63,6 +64,17 @@ module.exports = {
|
||||||
case "edit":
|
case "edit":
|
||||||
sendText = editCustomCommand(customName, message.author.id, customMessage)
|
sendText = editCustomCommand(customName, message.author.id, customMessage)
|
||||||
break;
|
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:
|
default:
|
||||||
sendText = `Argument not recognized.\n"${prefix}help custom" to see all arguments you can use.`
|
sendText = `Argument not recognized.\n"${prefix}help custom" to see all arguments you can use.`
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue