From b9754ed9df75652fa5d26f05232f06f928a4268b Mon Sep 17 00:00:00 2001 From: Monbrey Date: Sat, 5 Jun 2021 08:36:30 +1000 Subject: [PATCH] docs: updates and consistency --- src/structures/MessageActionRow.js | 24 ++++++++++--------- src/structures/MessageButton.js | 7 +++--- src/structures/MessageComponentInteraction.js | 6 ++--- .../MessageComponentInteractionCollector.js | 2 +- src/structures/MessageSelectMenu.js | 4 ++-- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/structures/MessageActionRow.js b/src/structures/MessageActionRow.js index 006ec909d81e0..f089c6a89bdd7 100644 --- a/src/structures/MessageActionRow.js +++ b/src/structures/MessageActionRow.js @@ -4,33 +4,35 @@ const BaseMessageComponent = require('./BaseMessageComponent'); const { MessageComponentTypes } = require('../util/Constants'); /** - * Represents an ActionRow containing message components. + * Represents an action row containing message components. * @extends {BaseMessageComponent} */ class MessageActionRow extends BaseMessageComponent { /** - * Components that can be placed in a MessageActionRow - * * MessageButton + * Components that can be placed in an action row + * * {@link MessageButton} + * * {@link MessageSelectMenu} * @typedef {MessageButton|MessageSelectMenu} MessageActionRowComponent */ /** - * Options for components that can be placed in a MessageActionRow - * * MessageButtonOptions + * Options for components that can be placed in an action row + * * {@link MessageButtonOptions} + * * {@link MessageSelectMenuOptions} * @typedef {MessageButtonOptions|MessageSelectMenuOptions} MessageActionRowComponentOptions */ /** - * Data that can be resolved into a components that can be placed in a MessageActionRow - * * MessageActionRowComponent - * * MessageActionRowComponentOptions + * Data that can be resolved into components that can be placed in an action row + * * {@link MessageActionRowComponent} + * * {@link MessageActionRowComponentOptions} * @typedef {MessageActionRowComponent|MessageActionRowComponentOptions} MessageActionRowComponentResolvable */ /** * @typedef {BaseMessageComponentOptions} MessageActionRowOptions * @property {MessageActionRowComponentResolvable[]} [components] - * The components to place in this ActionRow + * The components to place in this action row */ /** @@ -40,14 +42,14 @@ class MessageActionRow extends BaseMessageComponent { super({ type: 'ACTION_ROW' }); /** - * The components in this MessageActionRow + * The components in this action row * @type {MessageActionRowComponent[]} */ this.components = (data.components ?? []).map(c => BaseMessageComponent.create(c, null, true)); } /** - * Adds components to the row. + * Adds components to the action row. * @param {...MessageActionRowComponentResolvable[]} components The components to add * @returns {MessageActionRow} */ diff --git a/src/structures/MessageButton.js b/src/structures/MessageButton.js index 737e43685a7d0..5728959911f59 100644 --- a/src/structures/MessageButton.js +++ b/src/structures/MessageButton.js @@ -6,7 +6,7 @@ const { MessageButtonStyles, MessageComponentTypes } = require('../util/Constant const Util = require('../util/Util'); /** - * Represents a Button message component. + * Represents a button message component. * @extends {BaseMessageComponent} */ class MessageButton extends BaseMessageComponent { @@ -119,7 +119,8 @@ class MessageButton extends BaseMessageComponent { } /** - * Sets the URL of this button. MessageButton#style should be LINK + * Sets the URL of this button. + * MessageButton#style must be LINK when setting a URL * @param {string} url The URL of this button * @returns {MessageButton} */ @@ -153,7 +154,7 @@ class MessageButton extends BaseMessageComponent { */ /** - * Resolves the style of a MessageButton + * Resolves the style of a button * @param {MessageButtonStyleResolvable} style The style to resolve * @returns {MessageButtonStyle} * @private diff --git a/src/structures/MessageComponentInteraction.js b/src/structures/MessageComponentInteraction.js index 9becd53e5b4c8..44cad61e75204 100644 --- a/src/structures/MessageComponentInteraction.js +++ b/src/structures/MessageComponentInteraction.js @@ -21,13 +21,13 @@ class MessageComponentInteraction extends Interaction { this.message = data.message ? this.channel?.messages.add(data.message) ?? data.message : null; /** - * The custom ID of the component which was clicked + * The custom ID of the component which was interacted with * @type {string} */ this.customID = data.data.custom_id; /** - * The type of component that was interacted with + * The type of component which was interacted with * @type {string} */ this.componentType = MessageComponentInteraction.resolveType(data.data.component_type); @@ -51,7 +51,7 @@ class MessageComponentInteraction extends Interaction { this.webhook = new WebhookClient(this.applicationID, this.token, this.client.options); /** - * The values selected in a MessageSelectMenu interaction + * The values selected, if the component which was interacted with was a select menu * @type {string[]} */ this.values = this.componentType === 'SELECT_MENU' ? data.data.values : null; diff --git a/src/structures/MessageComponentInteractionCollector.js b/src/structures/MessageComponentInteractionCollector.js index 87cfae80ecbb5..36db24f56d794 100644 --- a/src/structures/MessageComponentInteractionCollector.js +++ b/src/structures/MessageComponentInteractionCollector.js @@ -40,7 +40,7 @@ class MessageComponentInteractionCollector extends Collector { this.channel = this.message ? this.message.channel : source; /** - * The users which have interacted to buttons on this collector + * The users which have interacted to components on this collector * @type {Collection} */ this.users = new Collection(); diff --git a/src/structures/MessageSelectMenu.js b/src/structures/MessageSelectMenu.js index 40e9c9e667afb..a57d53562372c 100644 --- a/src/structures/MessageSelectMenu.js +++ b/src/structures/MessageSelectMenu.js @@ -5,7 +5,7 @@ const { MessageComponentTypes } = require('../util/Constants'); const Util = require('../util/Util'); /** - * Represents a SelectMenu message components + * Represents a select menu message component * @extends {BaseMessageComponent} */ class MessageSelectMenu extends BaseMessageComponent { @@ -79,7 +79,7 @@ class MessageSelectMenu extends BaseMessageComponent { } /** - * Sets the maximum number of selection allowed for this select menu + * Sets the maximum number of selections allowed for this select menu * @param {number} maxValues Number of selections to be allowed * @returns {MessageSelectMenu} */