From 76317424faf106d0069dbbcebefe770700aeeb23 Mon Sep 17 00:00:00 2001 From: Khaazz Date: Thu, 20 Feb 2020 18:26:41 +0100 Subject: [PATCH] BREAKING(Command): Command.infos => Command.info --- src/AxonClient.js | 4 +-- src/Structures/Command/Command.js | 44 +++++++++++++++---------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/AxonClient.js b/src/AxonClient.js index eb53ed9b..0afa7d31 100755 --- a/src/AxonClient.js +++ b/src/AxonClient.js @@ -706,12 +706,12 @@ class AxonClient extends EventEmitter { for (const module of this.moduleRegistry.registry.values() ) { const commands = module.commands.filter(c => c.permissions.canExecute(msg, guildConfig)[0] ); if (commands.length > 0) { - commandList += `**${module.label}**\n${commands.map(c => `\`${prefix}${c.label}\` - ${c.infos.description}`).join('\n')}\n`; + commandList += `**${module.label}**\n${commands.map(c => `\`${prefix}${c.label}\` - ${c.info.description}`).join('\n')}\n`; } } } else { for (const module of this.moduleRegistry.registry.values() ) { - commandList += `**${module.label}**\n${module.commands.map(c => `\`${prefix}${c.label}\` - ${c.infos.description}`).join('\n')}\n`; + commandList += `**${module.label}**\n${module.commands.map(c => `\`${prefix}${c.label}\` - ${c.info.description}`).join('\n')}\n`; } } diff --git a/src/Structures/Command/Command.js b/src/Structures/Command/Command.js index 83d40bf9..e938c2e2 100755 --- a/src/Structures/Command/Command.js +++ b/src/Structures/Command/Command.js @@ -44,12 +44,12 @@ import { COMMAND_EXECUTION_STATE } from '../../Utility/Constants/AxonEnums'; * @prop {CommandCollection} [subCommands=null] - Collection of subcommands * @prop {Map} [subCommandsAliases=null] - Map of subcommand aliases * - * @prop {Object} infos - Default info about the command - * @prop {Array} [infos.owners] - Command authors - * @prop {String} [infos.name] - Full command name - * @prop {String} [infos.description] - Command description - * @prop {String} [infos.usage] - Command usage - * @prop {Array} [infos.example] - Array of command examples + * @prop {Object} info - Default info about the command + * @prop {Array} [info.owners] - Command authors + * @prop {String} [info.name] - Full command name + * @prop {String} [info.description] - Command description + * @prop {String} [info.usage] - Command usage + * @prop {Array} [info.example] - Array of command examples * * @prop {CommandOptions} options - Options Object for the command (manage all command options) * @prop {CommandPermissions} permissions - Permissions Object for the command (manage all command permissions) @@ -69,12 +69,12 @@ class Command extends Base { * @param {Boolean} [data.enabled] - Whether the command is enabled * @param {Boolean} [data.serverBypass] - Whether the command can be server disabled * @param {Array Command>} [data.subcmds] - List of subcommands class to be added in the Command - * @param {Object} [data.infos] - * @param {Array} [data.infos.owners] - Who created the command - * @param {String} [data.infos.description] - The command description - * @param {Array} [data.infos.examples] - Command examples - * @param {String} [data.infos.usage] - The command usage - * @param {String} [data.infos.name] - The full command name + * @param {Object} [data.info] + * @param {Array} [data.info.owners] - Who created the command + * @param {String} [data.info.description] - The command description + * @param {Array} [data.info.examples] - Command examples + * @param {String} [data.info.usage] - The command usage + * @param {String} [data.info.name] - The full command name * @param {CommandOptions|Object} [data.options] - The command options * @param {CommandPermissions|Object} [data.permissions] - The command permissions * @memberof Command @@ -110,8 +110,8 @@ class Command extends Base { /* Bypass all perms - true = prevent the command to be disabled */ this.serverBypass = data.serverBypass !== undefined ? data.serverBypass : module.serverBypass; // Default to module state - /* Command infos (help command) */ - this.infos = data.infos || { + /* Command info (help command) */ + this.info = data.info || { owners: [], // ['KhaaZ'] or ['KhaaZ', 'Jack'] name: null, // Full name of the command description: null, // 'A cool command that does things.' @@ -386,7 +386,7 @@ class Command extends Base { const embed = {}; embed.author = { - name: `Help for ${this.infos.name || this.fullLabel}`, + name: `Help for ${this.info.name || this.fullLabel}`, icon_url: this.library.client.getAvatar(), }; @@ -394,11 +394,11 @@ class Command extends Base { ? parseInt(this.template.embeds.help, 16) || null : this.template.embeds.help; - embed.description = `**Description:** ${this.infos.description}\n`; + embed.description = `**Description:** ${this.info.description}\n`; embed.description += `**Cooldown:** ${this.options.cooldown / 1000}s\n`; - embed.description += `**Usage:** ${prefix}${this.infos.usage || this.fullLabel}\n`; + embed.description += `**Usage:** ${prefix}${this.info.usage || this.fullLabel}\n`; let perm; if (this.permissions.serverOwner) { @@ -419,16 +419,16 @@ class Command extends Base { embed.description += `**Required:** ${perm}\n`; } - if (this.infos.examples && this.infos.examples.length > 0) { - this.infos.examples.length > 1 - ? embed.description += `\n**Examples:**\n${prefix}${this.infos.examples.join(`\n${prefix}`)}\n` - : embed.description += `**Example:** ${prefix}${this.infos.examples.join(`\n${prefix}`)}\n`; + if (this.info.examples && this.info.examples.length > 0) { + this.info.examples.length > 1 + ? embed.description += `\n**Examples:**\n${prefix}${this.info.examples.join(`\n${prefix}`)}\n` + : embed.description += `**Example:** ${prefix}${this.info.examples.join(`\n${prefix}`)}\n`; } embed.fields = []; /* SubCommands */ if (this.hasSubcmd) { - const subcmds = this.subCommands.getAll().filter(e => !e.options.hidden).map(e => `${prefix}${e.infos.usage}`); + const subcmds = this.subCommands.getAll().filter(e => !e.options.hidden).map(e => `${prefix}${e.info.usage}`); if (subcmds.length > 0) { embed.fields.push( { name: 'SubCommands:',