From 721d8ad66903ae55d75373affc340b9cf556c337 Mon Sep 17 00:00:00 2001 From: Zack Campbell Date: Sun, 11 Jun 2017 00:30:36 -0500 Subject: [PATCH] Rename Command/CommandInfo description -> desc, extraHelp -> info --- src/command/Command.ts | 6 +++--- src/command/base/Eval.ts | 2 +- src/command/base/EvalTS.ts | 4 ++-- src/command/base/Help.ts | 10 +++++----- src/command/base/Ping.ts | 2 +- src/command/base/Reload.ts | 4 ++-- src/command/base/SetPrefix.ts | 4 ++-- src/command/base/Version.ts | 2 +- src/command/base/blacklist/Blacklist.ts | 4 ++-- src/command/base/blacklist/Whitelist.ts | 2 +- src/command/base/groupcontrol/ClearLimit.ts | 2 +- src/command/base/groupcontrol/DisableGroup.ts | 4 ++-- src/command/base/groupcontrol/EnableGroup.ts | 4 ++-- src/command/base/groupcontrol/Limit.ts | 4 ++-- src/command/base/groupcontrol/ListGroups.ts | 4 ++-- src/types/CommandInfo.ts | 8 ++++---- 16 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/command/Command.ts b/src/command/Command.ts index 74322326..c453e8f3 100644 --- a/src/command/Command.ts +++ b/src/command/Command.ts @@ -14,9 +14,9 @@ export class Command { public client: T; public name: string; - public description: string; + public desc: string; public usage: string; - public extraHelp: string; + public info: string; public group: string; public aliases: string[]; public guildOnly: boolean; @@ -197,7 +197,7 @@ export class Command // Make necessary asserts if (!this.name) throw new Error(`A command is missing a name`); - if (!this.description) throw new Error(`A description must be provided for Command: ${this.name}`); + if (!this.desc) throw new Error(`A description must be provided for Command: ${this.name}`); if (!this.usage) throw new Error(`Usage information must be provided for Command: ${this.name}`); if (this.aliases && !Array.isArray(this.aliases)) throw new TypeError(`Aliases for Command "${this.name}" must be an array of alias strings`); if (this.callerPermissions && !Array.isArray(this.callerPermissions)) throw new TypeError(`\`callerPermissions\` for Command "${this.name}" must be an array`); diff --git a/src/command/base/Eval.ts b/src/command/base/Eval.ts index 20a620f1..cb54b12b 100644 --- a/src/command/base/Eval.ts +++ b/src/command/base/Eval.ts @@ -10,7 +10,7 @@ export default class extends Command { super({ name: 'eval', - description: 'Evaluate provided Javascript code', + desc: 'Evaluate provided Javascript code', usage: 'eval <...code>', ownerOnly: true }); diff --git a/src/command/base/EvalTS.ts b/src/command/base/EvalTS.ts index 472b9f75..8a861d3d 100644 --- a/src/command/base/EvalTS.ts +++ b/src/command/base/EvalTS.ts @@ -15,9 +15,9 @@ export default class extends Command { super({ name: 'eval:ts', - description: 'Evaluate provided Typescript code', + desc: 'Evaluate provided Typescript code', usage: 'eval:ts <...code>', - extraHelp: 'Runs pretty slowly due to having to run diagnostics before compiling. If Typescript is not installed the provided code will be evaluated as Javascript and diagnostics/compilation will be skipped.', + info: 'Runs pretty slowly due to having to run diagnostics before compiling. If Typescript is not installed the provided code will be evaluated as Javascript and diagnostics/compilation will be skipped.', ownerOnly: true }); } diff --git a/src/command/base/Help.ts b/src/command/base/Help.ts index 2ecfd482..1f58dbfc 100644 --- a/src/command/base/Help.ts +++ b/src/command/base/Help.ts @@ -9,9 +9,9 @@ export default class extends Command { super({ name: 'help', - description: 'Provides information on bot commands', + desc: 'Provides information on bot commands', usage: `help [command]`, - extraHelp: 'Will DM bot command help information to the user to keep clutter down in guild channels. If you use the help command from within a DM you will only receive information for the commands you can use within the DM. If you want help with commands usable in a guild, call the help command in a guild channel. You will receive a list of the commands that you have permissions/roles for in that channel.' + info: 'Will DM bot command help information to the user to keep clutter down in guild channels. If you use the help command from within a DM you will only receive information for the commands you can use within the DM. If you want help with commands usable in a guild, call the help command in a guild channel. You will receive a list of the commands that you have permissions/roles for in that channel.' }); } @@ -37,7 +37,7 @@ export default class extends Command const widest: number = usableCommands.map(c => c.name.length).reduce((a, b) => Math.max(a, b)); let commandList: string = usableCommands.map(c => - `${Util.padRight(c.name, widest + 1)}${c.guildOnly ? '*' : ' '}: ${c.description}`).sort().join('\n'); + `${Util.padRight(c.name, widest + 1)}${c.guildOnly ? '*' : ' '}: ${c.desc}`).sort().join('\n'); output = preText + commandList + postText; if (output.length >= 1024) @@ -67,10 +67,10 @@ export default class extends Command + (command.guildOnly ? '[Server Only]\n' : '') + (command.ownerOnly ? '[Owner Only]\n' : '') + `Command: ${command.name}\n` - + `Description: ${command.description}\n` + + `Description: ${command.desc}\n` + (command.aliases.length > 0 ? `Aliases: ${command.aliases.join(', ')}\n` : '') + `Usage: ${command.usage}\n` - + (command.extraHelp ? `\n${command.extraHelp}` : '') + + (command.info ? `\n${command.info}` : '') + '\n```'; } diff --git a/src/command/base/Ping.ts b/src/command/base/Ping.ts index 0053fffc..5d63b4b4 100644 --- a/src/command/base/Ping.ts +++ b/src/command/base/Ping.ts @@ -7,7 +7,7 @@ export default class extends Command { super({ name: 'ping', - description: 'Pong!', + desc: 'Pong!', usage: 'ping' }); } diff --git a/src/command/base/Reload.ts b/src/command/base/Reload.ts index 3f711c26..44d6dcb9 100644 --- a/src/command/base/Reload.ts +++ b/src/command/base/Reload.ts @@ -8,9 +8,9 @@ export default class extends Command { super({ name: 'reload', - description: 'Reload a command or all commands', + desc: 'Reload a command or all commands', usage: 'reload [command]', - extraHelp: `If a command name or alias is provided the specific command will be reloaded. Otherwise, all commands will be reloaded.`, + info: `If a command name or alias is provided the specific command will be reloaded. Otherwise, all commands will be reloaded.`, ownerOnly: true }); } diff --git a/src/command/base/SetPrefix.ts b/src/command/base/SetPrefix.ts index 6603af99..1ea74cb3 100644 --- a/src/command/base/SetPrefix.ts +++ b/src/command/base/SetPrefix.ts @@ -7,10 +7,10 @@ export default class extends Command { super({ name: 'setprefix', - description: 'Set or check command prefix', + desc: 'Set or check command prefix', aliases: ['prefix'], usage: 'setprefix [prefix]', - extraHelp: 'Prefixes may be 1-10 characters in length and may not include backslashes or backticks. Use "clear" to clear the prefix and allow commands to be called without a prefix.', + info: 'Prefixes may be 1-10 characters in length and may not include backslashes or backticks. Use "clear" to clear the prefix and allow commands to be called without a prefix.', callerPermissions: ['ADMINISTRATOR'] }); } diff --git a/src/command/base/Version.ts b/src/command/base/Version.ts index c0c9eea1..bfbdc929 100644 --- a/src/command/base/Version.ts +++ b/src/command/base/Version.ts @@ -7,7 +7,7 @@ export default class extends Command { super({ name: 'version', - description: 'Get the version of the bot', + desc: 'Get the version of the bot', usage: `version` }); } diff --git a/src/command/base/blacklist/Blacklist.ts b/src/command/base/blacklist/Blacklist.ts index d695551c..f7a609bc 100644 --- a/src/command/base/blacklist/Blacklist.ts +++ b/src/command/base/blacklist/Blacklist.ts @@ -11,10 +11,10 @@ export default class extends Command { super({ name: 'blacklist', - description: 'Blacklist a user from calling commands', + desc: 'Blacklist a user from calling commands', aliases: ['bl'], usage: 'blacklist [\'global\']', - extraHelp: 'If global, this will block the user from calling commands in ANY server and DMs', + info: 'If global, this will block the user from calling commands in ANY server and DMs', callerPermissions: ['ADMINISTRATOR'] }); } diff --git a/src/command/base/blacklist/Whitelist.ts b/src/command/base/blacklist/Whitelist.ts index fc6e4ceb..4a111436 100644 --- a/src/command/base/blacklist/Whitelist.ts +++ b/src/command/base/blacklist/Whitelist.ts @@ -11,7 +11,7 @@ export default class extends Command { super({ name: 'whitelist', - description: 'Remove a user from the command blacklist', + desc: 'Remove a user from the command blacklist', aliases: ['wl'], usage: 'whitelist [\'global\']', callerPermissions: ['ADMINISTRATOR'] diff --git a/src/command/base/groupcontrol/ClearLimit.ts b/src/command/base/groupcontrol/ClearLimit.ts index 0e533f9e..c4056583 100644 --- a/src/command/base/groupcontrol/ClearLimit.ts +++ b/src/command/base/groupcontrol/ClearLimit.ts @@ -12,7 +12,7 @@ export default class extends Command { super({ name: 'clearlimit', - description: 'Clear role restrictions from a command', + desc: 'Clear role restrictions from a command', usage: 'clearlimit ', callerPermissions: ['ADMINISTRATOR'] }); diff --git a/src/command/base/groupcontrol/DisableGroup.ts b/src/command/base/groupcontrol/DisableGroup.ts index a0632094..86896bfd 100644 --- a/src/command/base/groupcontrol/DisableGroup.ts +++ b/src/command/base/groupcontrol/DisableGroup.ts @@ -10,10 +10,10 @@ export default class extends Command { super({ name: 'disablegroup', - description: 'Disable a command group', + desc: 'Disable a command group', aliases: ['disable', 'dg'], usage: 'disablegroup ', - extraHelp: 'Disables a command group so that all of the commands in the group cannot be used on this server.', + info: 'Disables a command group so that all of the commands in the group cannot be used on this server.', callerPermissions: ['ADMINISTRATOR'] }); } diff --git a/src/command/base/groupcontrol/EnableGroup.ts b/src/command/base/groupcontrol/EnableGroup.ts index 21249c53..380d767b 100644 --- a/src/command/base/groupcontrol/EnableGroup.ts +++ b/src/command/base/groupcontrol/EnableGroup.ts @@ -10,10 +10,10 @@ export default class extends Command { super({ name: 'enablegroup', - description: 'Enable a command group', + desc: 'Enable a command group', aliases: ['enable', 'eg'], usage: 'enablegroup ', - extraHelp: 'Enables a command group so that all of the commands in the group can be used on this server.', + info: 'Enables a command group so that all of the commands in the group can be used on this server.', callerPermissions: ['ADMINISTRATOR'] }); } diff --git a/src/command/base/groupcontrol/Limit.ts b/src/command/base/groupcontrol/Limit.ts index d655b4ed..beed7096 100644 --- a/src/command/base/groupcontrol/Limit.ts +++ b/src/command/base/groupcontrol/Limit.ts @@ -13,9 +13,9 @@ export default class extends Command { super({ name: 'limit', - description: 'Limit a command to the provided roles', + desc: 'Limit a command to the provided roles', usage: 'limit , ', - extraHelp: 'The comma after the command name -- before the role names list -- is necessary.', + info: 'The comma after the command name -- before the role names list -- is necessary.', argOpts: { separator: ',' }, callerPermissions: ['ADMINISTRATOR'] }); diff --git a/src/command/base/groupcontrol/ListGroups.ts b/src/command/base/groupcontrol/ListGroups.ts index 631cd95e..ed60e6b8 100644 --- a/src/command/base/groupcontrol/ListGroups.ts +++ b/src/command/base/groupcontrol/ListGroups.ts @@ -7,10 +7,10 @@ export default class extends Command { super({ name: 'listgroups', - description: 'List all command groups and their status', + desc: 'List all command groups and their status', aliases: ['lg'], usage: 'listgroups', - extraHelp: `A '*' denotes a disabled group when listing all command groups.`, + info: `A '*' denotes a disabled group when listing all command groups.`, callerPermissions: ['ADMINISTRATOR'] }); } diff --git a/src/types/CommandInfo.ts b/src/types/CommandInfo.ts index 3e99f428..c7ca716b 100644 --- a/src/types/CommandInfo.ts +++ b/src/types/CommandInfo.ts @@ -2,9 +2,9 @@ * @typedef {Object} CommandInfo - Object containing required {@link Command} properties * to be passed to a Command on construction * @property {string} name See: {@link Command#name} - * @property {string} description See: {@link Command#description} + * @property {string} desc See: {@link Command#desc} * @property {string} usage See: {@link Command#usage} - * @property {string} [extraHelp] See: {@link Command#extraHelp} + * @property {string} [info] See: {@link Command#info} * @property {string} [group='base'] See: {@link Command#group} * @property {string[]} [aliases=[]] See: {@link Command#aliases} * @property {boolean} [guildOnly=false] See: {@link Command#guildOnly} @@ -24,10 +24,10 @@ import { ArgOpts } from './ArgOpts'; export type CommandInfo = { name: string; - description: string; + desc: string; usage: string; group?: string; - extraHelp?: string; + info?: string; aliases?: string[]; guildOnly?: boolean; hidden?: boolean;