Skip to content

Commit

Permalink
docs: add new typedef to properly doc InteractionReplyOptions (#5632)
Browse files Browse the repository at this point in the history
  • Loading branch information
iShibi committed May 26, 2021
1 parent ed593c9 commit 3589e0f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 25 deletions.
3 changes: 2 additions & 1 deletion src/structures/CommandInteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ class CommandInteraction extends Interaction {

/**
* Options for a reply to an interaction.
* @typedef {WebhookMessageOptions} InteractionReplyOptions
* @typedef {BaseMessageOptions} InteractionReplyOptions
* @property {boolean} [ephemeral] Whether the reply should be ephemeral
* @property {MessageEmbed[]|Object[]} [embeds] An array of embeds for the message
*/

/**
Expand Down
10 changes: 1 addition & 9 deletions src/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,17 +581,9 @@ class Message extends Base {

/**
* Options provided when sending a message as an inline reply.
* @typedef {Object} ReplyMessageOptions
* @property {boolean} [tts=false] Whether or not the message should be spoken aloud
* @property {string} [nonce=''] The nonce for the message
* @property {string} [content=''] The content for the message
* @typedef {BaseMessageOptions} ReplyMessageOptions
* @property {MessageEmbed|Object} [embed] An embed for the message
* (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details)
* @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
* @property {FileOptions[]|BufferResolvable[]} [files] Files to send with the message
* @property {string|boolean} [code] Language for optional codeblock formatting to apply
* @property {boolean|SplitOptions} [split=false] Whether or not the message should be split into multiple messages if
* it exceeds the character limit. If an object is provided, these are the options for splitting the message
* @property {boolean} [failIfNotExists=true] Whether to error if the referenced message
* does not exist (creates a standard message in this case when false)
*/
Expand Down
11 changes: 1 addition & 10 deletions src/structures/Webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,10 @@ class Webhook {

/**
* Options that can be passed into send.
* @typedef {Object} WebhookMessageOptions
* @typedef {BaseMessageOptions} WebhookMessageOptions
* @property {string} [username=this.name] Username override for the message
* @property {string} [avatarURL] Avatar URL override for the message
* @property {boolean} [tts=false] Whether or not the message should be spoken aloud
* @property {StringResolvable} [content] The content for the message
* @property {string} [nonce=''] The nonce for the message
* @property {MessageEmbed[]|Object[]} [embeds] An array of embeds for the message
* @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
* (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details)
* @property {FileOptions[]|string[]} [files] Files to send with the message
* @property {string|boolean} [code] Language for optional codeblock formatting to apply
* @property {boolean|SplitOptions} [split=false] Whether or not the message should be split into multiple messages if
* it exceeds the character limit. If an object is provided, these are the options for splitting the message.
*/

/**
Expand Down
16 changes: 11 additions & 5 deletions src/structures/interfaces/TextBasedChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,24 @@ class TextBasedChannel {
}

/**
* Options provided when sending or editing a message.
* @typedef {Object} MessageOptions
* Base options provided when sending.
* @typedef {Object} BaseMessageOptions
* @property {boolean} [tts=false] Whether or not the message should be spoken aloud
* @property {string} [nonce=''] The nonce for the message
* @property {string} [content=''] The content for the message
* @property {MessageEmbed|Object} [embed] An embed for the message
* (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details)
* @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
* @property {FileOptions[]|BufferResolvable[]} [files] Files to send with the message
* (see [here](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) for more details)
* @property {FileOptions[]|BufferResolvable[]|MessageAttachment[]} [files] Files to send with the message
* @property {string|boolean} [code] Language for optional codeblock formatting to apply
* @property {boolean|SplitOptions} [split=false] Whether or not the message should be split into multiple messages if
* it exceeds the character limit. If an object is provided, these are the options for splitting the message
*/

/**
* Options provided when sending or editing a message.
* @typedef {BaseMessageOptions} MessageOptions
* @property {MessageEmbed|Object} [embed] An embed for the message
* (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details)
* @property {ReplyOptions} [reply] The options for replying to a message
*/

Expand Down

0 comments on commit 3589e0f

Please sign in to comment.