From 18986f5f02d4e8499dcb4c44ca4cf9f48227e855 Mon Sep 17 00:00:00 2001 From: Synbulat Biishev Date: Fri, 11 Nov 2022 16:44:18 +0300 Subject: [PATCH 1/2] feat: rename interaction methods --- .../src/structures/CommandInteraction.js | 8 +-- .../structures/MessageComponentInteraction.js | 10 ++-- .../src/structures/ModalSubmitInteraction.js | 10 ++-- .../interfaces/InteractionResponses.js | 50 +++++++++---------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/packages/discord.js/src/structures/CommandInteraction.js b/packages/discord.js/src/structures/CommandInteraction.js index ec6ef404b0f5..f7318d60b8f6 100644 --- a/packages/discord.js/src/structures/CommandInteraction.js +++ b/packages/discord.js/src/structures/CommandInteraction.js @@ -205,15 +205,15 @@ class CommandInteraction extends BaseInteraction { /* eslint-disable no-empty-function */ deferReply() {} reply() {} - fetchReply() {} - editReply() {} - deleteReply() {} + fetchResponse() {} + editResponse() {} + deleteResponse() {} followUp() {} showModal() {} awaitModalSubmit() {} } -InteractionResponses.applyToClass(CommandInteraction, ['deferUpdate', 'update']); +InteractionResponses.applyToClass(CommandInteraction, ['deferMessageUpdate', 'updateMessage']); module.exports = CommandInteraction; diff --git a/packages/discord.js/src/structures/MessageComponentInteraction.js b/packages/discord.js/src/structures/MessageComponentInteraction.js index 9ffa99354481..551a0666b58f 100644 --- a/packages/discord.js/src/structures/MessageComponentInteraction.js +++ b/packages/discord.js/src/structures/MessageComponentInteraction.js @@ -87,12 +87,12 @@ class MessageComponentInteraction extends BaseInteraction { /* eslint-disable no-empty-function */ deferReply() {} reply() {} - fetchReply() {} - editReply() {} - deleteReply() {} + fetchResponse() {} + editResponse() {} + deleteResponse() {} followUp() {} - deferUpdate() {} - update() {} + deferMessageUpdate() {} + updateMessage() {} showModal() {} awaitModalSubmit() {} } diff --git a/packages/discord.js/src/structures/ModalSubmitInteraction.js b/packages/discord.js/src/structures/ModalSubmitInteraction.js index f10eb476d640..159f2293aee6 100644 --- a/packages/discord.js/src/structures/ModalSubmitInteraction.js +++ b/packages/discord.js/src/structures/ModalSubmitInteraction.js @@ -108,12 +108,12 @@ class ModalSubmitInteraction extends BaseInteraction { /* eslint-disable no-empty-function */ deferReply() {} reply() {} - fetchReply() {} - editReply() {} - deleteReply() {} + fetchResponse() {} + editResponse() {} + deleteResponse() {} followUp() {} - deferUpdate() {} - update() {} + deferMessageUpdate() {} + updateMessage() {} } InteractionResponses.applyToClass(ModalSubmitInteraction, 'showModal'); diff --git a/packages/discord.js/src/structures/interfaces/InteractionResponses.js b/packages/discord.js/src/structures/interfaces/InteractionResponses.js index 5d07325756b0..4cb2aba42855 100644 --- a/packages/discord.js/src/structures/interfaces/InteractionResponses.js +++ b/packages/discord.js/src/structures/interfaces/InteractionResponses.js @@ -23,13 +23,13 @@ class InteractionResponses { * Options for deferring the reply to an {@link BaseInteraction}. * @typedef {Object} InteractionDeferReplyOptions * @property {boolean} [ephemeral] Whether the reply should be ephemeral - * @property {boolean} [fetchReply] Whether to fetch the reply + * @property {boolean} [fetchResponse] Whether to fetch the reply */ /** * Options for deferring and updating the reply to a {@link MessageComponentInteraction}. * @typedef {Object} InteractionDeferUpdateOptions - * @property {boolean} [fetchReply] Whether to fetch the reply + * @property {boolean} [fetchResponse] Whether to fetch the reply */ /** @@ -37,7 +37,7 @@ class InteractionResponses { * @typedef {BaseMessageOptions} InteractionReplyOptions * @property {boolean} [tts=false] Whether the message should be spoken aloud * @property {boolean} [ephemeral] Whether the reply should be ephemeral - * @property {boolean} [fetchReply] Whether to fetch the reply + * @property {boolean} [fetchResponse] Whether to fetch the reply * @property {MessageFlags} [flags] Which flags to set for the message. * Only `MessageFlags.SuppressEmbeds` and `MessageFlags.Ephemeral` can be set. */ @@ -45,7 +45,7 @@ class InteractionResponses { /** * Options for updating the message received from a {@link MessageComponentInteraction}. * @typedef {MessageEditOptions} InteractionUpdateOptions - * @property {boolean} [fetchReply] Whether to fetch the reply + * @property {boolean} [fetchResponse] Whether to fetch the reply */ /** @@ -77,17 +77,17 @@ class InteractionResponses { }); this.deferred = true; - return options.fetchReply ? this.fetchReply() : new InteractionResponse(this); + return options.fetchResponse ? this.fetchResponse() : new InteractionResponse(this); } /** * Creates a reply to this interaction. - * Use the `fetchReply` option to get the bot's reply message. + * Use the `fetchResponse` option to get the bot's reply message. * @param {string|MessagePayload|InteractionReplyOptions} options The options for the reply * @returns {Promise} * @example * // Reply to the interaction and fetch the response - * interaction.reply({ content: 'Pong!', fetchReply: true }) + * interaction.reply({ content: 'Pong!', fetchResponse: true }) * .then((message) => console.log(`Reply sent with content ${message.content}`)) * .catch(console.error); * @example @@ -118,7 +118,7 @@ class InteractionResponses { }); this.replied = true; - return options.fetchReply ? this.fetchReply() : new InteractionResponse(this); + return options.fetchResponse ? this.fetchResponse() : new InteractionResponse(this); } /** @@ -128,11 +128,11 @@ class InteractionResponses { * @returns {Promise} * @example * // Fetch the initial reply to this interaction - * interaction.fetchReply() + * interaction.fetchResponse() * .then(reply => console.log(`Replied with ${reply.content}`)) * .catch(console.error); */ - fetchReply(message = '@original') { + fetchResponse(message = '@original') { return this.webhook.fetchMessage(message); } @@ -148,11 +148,11 @@ class InteractionResponses { * @returns {Promise} * @example * // Edit the initial reply to this interaction - * interaction.editReply('New content') + * interaction.editResponse('New content') * .then(console.log) * .catch(console.error); */ - async editReply(options) { + async editResponse(options) { if (!this.deferred && !this.replied) throw new DiscordjsError(ErrorCodes.InteractionNotReplied); const msg = await this.webhook.editMessage(options.message ?? '@original', options); this.replied = true; @@ -166,11 +166,11 @@ class InteractionResponses { * @returns {Promise} * @example * // Delete the initial reply to this interaction - * interaction.deleteReply() + * interaction.deleteResponse() * .then(console.log) * .catch(console.error); */ - async deleteReply(message = '@original') { + async deleteResponse(message = '@original') { await this.webhook.deleteMessage(message); } @@ -190,11 +190,11 @@ class InteractionResponses { * @returns {Promise} * @example * // Defer updating and reset the component's loading state - * interaction.deferUpdate() + * interaction.deferMessageUpdate() * .then(console.log) * .catch(console.error); */ - async deferUpdate(options = {}) { + async deferMessageUpdate(options = {}) { if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied); await this.client.rest.post(Routes.interactionCallback(this.id, this.token), { body: { @@ -204,7 +204,7 @@ class InteractionResponses { }); this.deferred = true; - return options.fetchReply ? this.fetchReply() : new InteractionResponse(this, this.message?.interaction?.id); + return options.fetchResponse ? this.fetchResponse() : new InteractionResponse(this, this.message?.interaction?.id); } /** @@ -213,14 +213,14 @@ class InteractionResponses { * @returns {Promise} * @example * // Remove the components from the message - * interaction.update({ + * interaction.updateMessage({ * content: "A component interaction was received", * components: [] * }) * .then(console.log) * .catch(console.error); */ - async update(options) { + async updateMessage(options) { if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied); let messagePayload; @@ -239,7 +239,7 @@ class InteractionResponses { }); this.replied = true; - return options.fetchReply ? this.fetchReply() : new InteractionResponse(this, this.message.interaction?.id); + return options.fetchResponse ? this.fetchResponse() : new InteractionResponse(this, this.message.interaction?.id); } /** @@ -294,12 +294,12 @@ class InteractionResponses { const props = [ 'deferReply', 'reply', - 'fetchReply', - 'editReply', - 'deleteReply', + 'fetchResponse', + 'editResponse', + 'deleteResponse', 'followUp', - 'deferUpdate', - 'update', + 'deferMessageUpdate', + 'updateMessage', 'showModal', 'awaitModalSubmit', ]; From 987aa3be16da61ccb6cd120a35e13b524233389b Mon Sep 17 00:00:00 2001 From: Synbulat Biishev Date: Fri, 11 Nov 2022 17:00:46 +0300 Subject: [PATCH 2/2] types: update types --- .../src/structures/MessagePayload.js | 2 +- .../interfaces/InteractionResponses.js | 12 +- packages/discord.js/typings/index.d.ts | 80 +++++++------ packages/discord.js/typings/index.test-d.ts | 112 +++++++++--------- 4 files changed, 106 insertions(+), 100 deletions(-) diff --git a/packages/discord.js/src/structures/MessagePayload.js b/packages/discord.js/src/structures/MessagePayload.js index dacbc2222292..15c4e5f6e6b2 100644 --- a/packages/discord.js/src/structures/MessagePayload.js +++ b/packages/discord.js/src/structures/MessagePayload.js @@ -288,7 +288,7 @@ module.exports = MessagePayload; /** * A possible payload option. * @typedef {MessageCreateOptions|MessageEditOptions|WebhookCreateMessageOptions|WebhookEditMessageOptions| - * InteractionReplyOptions|InteractionUpdateOptions} MessagePayloadOption + * InteractionReplyOptions|InteractionUpdateMessageOptions} MessagePayloadOption */ /** diff --git a/packages/discord.js/src/structures/interfaces/InteractionResponses.js b/packages/discord.js/src/structures/interfaces/InteractionResponses.js index 4cb2aba42855..8a906246ef9c 100644 --- a/packages/discord.js/src/structures/interfaces/InteractionResponses.js +++ b/packages/discord.js/src/structures/interfaces/InteractionResponses.js @@ -28,7 +28,7 @@ class InteractionResponses { /** * Options for deferring and updating the reply to a {@link MessageComponentInteraction}. - * @typedef {Object} InteractionDeferUpdateOptions + * @typedef {Object} InteractionDeferMessageUpdateOptions * @property {boolean} [fetchResponse] Whether to fetch the reply */ @@ -44,7 +44,7 @@ class InteractionResponses { /** * Options for updating the message received from a {@link MessageComponentInteraction}. - * @typedef {MessageEditOptions} InteractionUpdateOptions + * @typedef {MessageEditOptions} InteractionUpdateMessageOptions * @property {boolean} [fetchResponse] Whether to fetch the reply */ @@ -137,14 +137,14 @@ class InteractionResponses { } /** - * @typedef {WebhookEditMessageOptions} InteractionEditReplyOptions + * @typedef {WebhookEditMessageOptions} InteractionEditResponseOptions * @property {MessageResolvable|'@original'} [message='@original'] The response to edit */ /** * Edits a reply to this interaction. * @see Webhook#editMessage - * @param {string|MessagePayload|InteractionEditReplyOptions} options The new options for the message + * @param {string|MessagePayload|InteractionEditResponseOptions} options The new options for the message * @returns {Promise} * @example * // Edit the initial reply to this interaction @@ -186,7 +186,7 @@ class InteractionResponses { /** * Defers an update to the message to which the component was attached. - * @param {InteractionDeferUpdateOptions} [options] Options for deferring the update to this interaction + * @param {InteractionDeferMessageUpdateOptions} [options] Options for deferring the update to this interaction * @returns {Promise} * @example * // Defer updating and reset the component's loading state @@ -209,7 +209,7 @@ class InteractionResponses { /** * Updates the original message of the component on which the interaction was received on. - * @param {string|MessagePayload|InteractionUpdateOptions} options The options for the updated message + * @param {string|MessagePayload|InteractionUpdateMessageOptions} options The options for the updated message * @returns {Promise} * @example * // Remove the components from the message diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 437db959f4d5..cb19bb46b602 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -457,16 +457,16 @@ export abstract class CommandInteraction e public inCachedGuild(): this is CommandInteraction<'cached'>; public inRawGuild(): this is CommandInteraction<'raw'>; public deferReply( - options: InteractionDeferReplyOptions & { fetchReply: true }, + options: InteractionDeferReplyOptions & { fetchResponse: true }, ): Promise>>; public deferReply(options?: InteractionDeferReplyOptions): Promise>>; - public deleteReply(message?: MessageResolvable | '@original'): Promise; - public editReply( - options: string | MessagePayload | InteractionEditReplyOptions, + public deleteResponse(message?: MessageResolvable | '@original'): Promise; + public editResponse( + options: string | MessagePayload | InteractionEditResponseOptions, ): Promise>>; - public fetchReply(message?: Snowflake | '@original'): Promise>>; + public fetchResponse(message?: Snowflake | '@original'): Promise>>; public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise>>; - public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise>>; + public reply(options: InteractionReplyOptions & { fetchResponse: true }): Promise>>; public reply( options: string | MessagePayload | InteractionReplyOptions, ): Promise>>; @@ -1905,26 +1905,30 @@ export class MessageComponentInteraction e public inCachedGuild(): this is MessageComponentInteraction<'cached'>; public inRawGuild(): this is MessageComponentInteraction<'raw'>; public deferReply( - options: InteractionDeferReplyOptions & { fetchReply: true }, + options: InteractionDeferReplyOptions & { fetchResponse: true }, ): Promise>>; public deferReply(options?: InteractionDeferReplyOptions): Promise>>; - public deferUpdate( - options: InteractionDeferUpdateOptions & { fetchReply: true }, + public deferMessageUpdate( + options: InteractionDeferMessageUpdateOptions & { fetchResponse: true }, ): Promise>>; - public deferUpdate(options?: InteractionDeferUpdateOptions): Promise>>; - public deleteReply(message?: MessageResolvable | '@original'): Promise; - public editReply( - options: string | MessagePayload | InteractionEditReplyOptions, + public deferMessageUpdate( + options?: InteractionDeferMessageUpdateOptions, + ): Promise>>; + public deleteResponse(message?: MessageResolvable | '@original'): Promise; + public editResponse( + options: string | MessagePayload | InteractionEditResponseOptions, ): Promise>>; - public fetchReply(message?: Snowflake | '@original'): Promise>>; + public fetchResponse(message?: Snowflake | '@original'): Promise>>; public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise>>; - public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise>>; + public reply(options: InteractionReplyOptions & { fetchResponse: true }): Promise>>; public reply( options: string | MessagePayload | InteractionReplyOptions, ): Promise>>; - public update(options: InteractionUpdateOptions & { fetchReply: true }): Promise>>; - public update( - options: string | MessagePayload | InteractionUpdateOptions, + public updateMessage( + options: InteractionUpdateMessageOptions & { fetchResponse: true }, + ): Promise>>; + public updateMessage( + options: string | MessagePayload | InteractionUpdateMessageOptions, ): Promise>>; public showModal( modal: @@ -1994,7 +1998,7 @@ export type MessagePayloadOption = | WebhookCreateMessageOptions | WebhookEditMessageOptions | InteractionReplyOptions - | InteractionUpdateOptions; + | InteractionUpdateMessageOptions; export class MessagePayload { public constructor(target: MessageTarget, options: MessagePayloadOption); @@ -2078,9 +2082,9 @@ export interface ModalMessageModalSubmitInteraction { message: Message>; channelId: Snowflake; - update(options: InteractionUpdateOptions & { fetchReply: true }): Promise; - update( - options: string | MessagePayload | InteractionUpdateOptions, + updateMessage(options: InteractionUpdateMessageOptions & { fetchResponse: true }): Promise; + updateMessage( + options: string | MessagePayload | InteractionUpdateMessageOptions, ): Promise>>; inGuild(): this is ModalMessageModalSubmitInteraction<'raw' | 'cached'>; inCachedGuild(): this is ModalMessageModalSubmitInteraction<'cached'>; @@ -2098,24 +2102,26 @@ export class ModalSubmitInteraction extend public message: Message> | null; public replied: boolean; public readonly webhook: InteractionWebhook; - public reply(options: InteractionReplyOptions & { fetchReply: true }): Promise>>; + public reply(options: InteractionReplyOptions & { fetchResponse: true }): Promise>>; public reply( options: string | MessagePayload | InteractionReplyOptions, ): Promise>>; - public deleteReply(message?: MessageResolvable | '@original'): Promise; - public editReply( - options: string | MessagePayload | InteractionEditReplyOptions, + public deleteResponse(message?: MessageResolvable | '@original'): Promise; + public editResponse( + options: string | MessagePayload | InteractionEditResponseOptions, ): Promise>>; public deferReply( - options: InteractionDeferReplyOptions & { fetchReply: true }, + options: InteractionDeferReplyOptions & { fetchResponse: true }, ): Promise>>; public deferReply(options?: InteractionDeferReplyOptions): Promise>>; - public fetchReply(message?: Snowflake | '@original'): Promise>>; + public fetchResponse(message?: Snowflake | '@original'): Promise>>; public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise>>; - public deferUpdate( - options: InteractionDeferUpdateOptions & { fetchReply: true }, + public deferMessageUpdate( + options: InteractionDeferMessageUpdateOptions & { fetchResponse: true }, ): Promise>>; - public deferUpdate(options?: InteractionDeferUpdateOptions): Promise>>; + public deferMessageUpdate( + options?: InteractionDeferMessageUpdateOptions, + ): Promise>>; public inGuild(): this is ModalSubmitInteraction<'raw' | 'cached'>; public inCachedGuild(): this is ModalSubmitInteraction<'cached'>; public inRawGuild(): this is ModalSubmitInteraction<'raw'>; @@ -5353,23 +5359,23 @@ export interface InteractionCollectorOptions; +export type InteractionDeferMessageUpdateOptions = Omit; export interface InteractionReplyOptions extends BaseMessageOptions { tts?: boolean; ephemeral?: boolean; - fetchReply?: boolean; + fetchResponse?: boolean; flags?: BitFieldResolvable< Extract, MessageFlags.Ephemeral | MessageFlags.SuppressEmbeds >; } -export interface InteractionUpdateOptions extends MessageEditOptions { - fetchReply?: boolean; +export interface InteractionUpdateMessageOptions extends MessageEditOptions { + fetchResponse?: boolean; } export interface InviteGenerationOptions { @@ -5978,7 +5984,7 @@ export interface WebhookEditMessageOptions extends Omit { expectAssignable>(message); const component = await message.awaitMessageComponent({ componentType: ComponentType.Button }); expectType>(component); - expectType>(await component.reply({ fetchReply: true })); + expectType>(await component.reply({ fetchResponse: true })); const buttonCollector = message.createMessageComponentCollector({ componentType: ComponentType.Button }); expectType>>(buttonCollector); @@ -1523,36 +1523,36 @@ client.on('interactionCreate', async interaction => { expectType(interaction.component); expectType>(interaction.message); expectType(interaction.guild); - expectType>>(interaction.reply({ content: 'a', fetchReply: true })); - expectType>>(interaction.deferReply({ fetchReply: true })); - expectType>>(interaction.editReply({ content: 'a' })); - expectType>>(interaction.fetchReply()); - expectType>>(interaction.update({ content: 'a', fetchReply: true })); - expectType>>(interaction.deferUpdate({ fetchReply: true })); + expectType>>(interaction.reply({ content: 'a', fetchResponse: true })); + expectType>>(interaction.deferReply({ fetchResponse: true })); + expectType>>(interaction.editResponse({ content: 'a' })); + expectType>>(interaction.fetchResponse()); + expectType>>(interaction.updateMessage({ content: 'a', fetchResponse: true })); + expectType>>(interaction.deferMessageUpdate({ fetchResponse: true })); expectType>>(interaction.followUp({ content: 'a' })); } else if (interaction.inRawGuild()) { expectAssignable(interaction); expectType(interaction.component); expectType>(interaction.message); expectType(interaction.guild); - expectType>>(interaction.reply({ content: 'a', fetchReply: true })); - expectType>>(interaction.deferReply({ fetchReply: true })); - expectType>>(interaction.editReply({ content: 'a' })); - expectType>>(interaction.fetchReply()); - expectType>>(interaction.update({ content: 'a', fetchReply: true })); - expectType>>(interaction.deferUpdate({ fetchReply: true })); + expectType>>(interaction.reply({ content: 'a', fetchResponse: true })); + expectType>>(interaction.deferReply({ fetchResponse: true })); + expectType>>(interaction.editResponse({ content: 'a' })); + expectType>>(interaction.fetchResponse()); + expectType>>(interaction.updateMessage({ content: 'a', fetchResponse: true })); + expectType>>(interaction.deferMessageUpdate({ fetchResponse: true })); expectType>>(interaction.followUp({ content: 'a' })); } else if (interaction.inGuild()) { expectAssignable(interaction); expectType(interaction.component); expectType(interaction.message); expectType(interaction.guild); - expectType>(interaction.reply({ content: 'a', fetchReply: true })); - expectType>(interaction.deferReply({ fetchReply: true })); - expectType>(interaction.editReply({ content: 'a' })); - expectType>(interaction.fetchReply()); - expectType>(interaction.update({ content: 'a', fetchReply: true })); - expectType>(interaction.deferUpdate({ fetchReply: true })); + expectType>(interaction.reply({ content: 'a', fetchResponse: true })); + expectType>(interaction.deferReply({ fetchResponse: true })); + expectType>(interaction.editResponse({ content: 'a' })); + expectType>(interaction.fetchResponse()); + expectType>(interaction.updateMessage({ content: 'a', fetchResponse: true })); + expectType>(interaction.deferMessageUpdate({ fetchResponse: true })); expectType>(interaction.followUp({ content: 'a' })); } } @@ -1584,26 +1584,26 @@ client.on('interactionCreate', async interaction => { expectAssignable(interaction); expectAssignable(interaction.guild); expectAssignable>(interaction); - expectType>>(interaction.reply({ content: 'a', fetchReply: true })); - expectType>>(interaction.deferReply({ fetchReply: true })); - expectType>>(interaction.editReply({ content: 'a' })); - expectType>>(interaction.fetchReply()); + expectType>>(interaction.reply({ content: 'a', fetchResponse: true })); + expectType>>(interaction.deferReply({ fetchResponse: true })); + expectType>>(interaction.editResponse({ content: 'a' })); + expectType>>(interaction.fetchResponse()); expectType>>(interaction.followUp({ content: 'a' })); } else if (interaction.inRawGuild()) { expectAssignable(interaction); expectType(interaction.guild); - expectType>>(interaction.reply({ content: 'a', fetchReply: true })); - expectType>>(interaction.deferReply({ fetchReply: true })); - expectType>>(interaction.editReply({ content: 'a' })); - expectType>>(interaction.fetchReply()); + expectType>>(interaction.reply({ content: 'a', fetchResponse: true })); + expectType>>(interaction.deferReply({ fetchResponse: true })); + expectType>>(interaction.editResponse({ content: 'a' })); + expectType>>(interaction.fetchResponse()); expectType>>(interaction.followUp({ content: 'a' })); } else if (interaction.inGuild()) { expectAssignable(interaction); expectType(interaction.guild); - expectType>(interaction.reply({ content: 'a', fetchReply: true })); - expectType>(interaction.deferReply({ fetchReply: true })); - expectType>(interaction.editReply({ content: 'a' })); - expectType>(interaction.fetchReply()); + expectType>(interaction.reply({ content: 'a', fetchResponse: true })); + expectType>(interaction.deferReply({ fetchResponse: true })); + expectType>(interaction.editResponse({ content: 'a' })); + expectType>(interaction.fetchResponse()); expectType>(interaction.followUp({ content: 'a' })); } } @@ -1631,19 +1631,19 @@ client.on('interactionCreate', async interaction => { expectType(interaction.component); expectType>(interaction.message); expectType(interaction.guild); - expectType>>(interaction.reply({ fetchReply: true })); + expectType>>(interaction.reply({ fetchResponse: true })); } else if (interaction.inRawGuild()) { expectAssignable(interaction); expectType(interaction.component); expectType>(interaction.message); expectType(interaction.guild); - expectType>>(interaction.reply({ fetchReply: true })); + expectType>>(interaction.reply({ fetchResponse: true })); } else if (interaction.inGuild()) { expectAssignable(interaction); expectType(interaction.component); expectType(interaction.message); expectAssignable(interaction.guild); - expectType>(interaction.reply({ fetchReply: true })); + expectType>(interaction.reply({ fetchResponse: true })); } } @@ -1659,19 +1659,19 @@ client.on('interactionCreate', async interaction => { expectType(interaction.component); expectType>(interaction.message); expectType(interaction.guild); - expectType>>(interaction.reply({ fetchReply: true })); + expectType>>(interaction.reply({ fetchResponse: true })); } else if (interaction.inRawGuild()) { expectAssignable(interaction); expectType(interaction.component); expectType>(interaction.message); expectType(interaction.guild); - expectType>>(interaction.reply({ fetchReply: true })); + expectType>>(interaction.reply({ fetchResponse: true })); } else if (interaction.inGuild()) { expectAssignable(interaction); expectType(interaction.component); expectType(interaction.message); expectType(interaction.guild); - expectType>(interaction.reply({ fetchReply: true })); + expectType>(interaction.reply({ fetchResponse: true })); } } @@ -1682,13 +1682,13 @@ client.on('interactionCreate', async interaction => { if (interaction.inRawGuild()) { expectNotAssignable>(interaction); expectAssignable(interaction); - expectType>>(interaction.reply({ fetchReply: true })); + expectType>>(interaction.reply({ fetchResponse: true })); expectType(interaction.options.getMember('test')); expectType(interaction.options.getChannel('test', true)); expectType(interaction.options.getRole('test', true)); } else if (interaction.inCachedGuild()) { - const msg = await interaction.reply({ fetchReply: true }); + const msg = await interaction.reply({ fetchResponse: true }); const btn = await msg.awaitMessageComponent({ componentType: ComponentType.Button }); expectType>(msg); @@ -1696,7 +1696,7 @@ client.on('interactionCreate', async interaction => { expectType(interaction.options.getMember('test')); expectAssignable(interaction); - expectType>>(interaction.reply({ fetchReply: true })); + expectType>>(interaction.reply({ fetchResponse: true })); expectType(interaction.options.getChannel('test', true)); expectType(interaction.options.getRole('test', true)); @@ -1704,7 +1704,7 @@ client.on('interactionCreate', async interaction => { // @ts-expect-error consumeCachedCommand(interaction); expectType(interaction); - expectType>(interaction.reply({ fetchReply: true })); + expectType>(interaction.reply({ fetchResponse: true })); expectType(interaction.options.getMember('test')); expectType(interaction.options.getChannel('test', true)); @@ -1755,29 +1755,29 @@ client.on('interactionCreate', async interaction => { if (interaction.inCachedGuild()) { expectAssignable(interaction); expectType(interaction.guild); - expectType>>(interaction.reply({ content: 'a', fetchReply: true })); - expectType>>(interaction.deferReply({ fetchReply: true })); - expectType>>(interaction.editReply({ content: 'a' })); - expectType>>(interaction.fetchReply()); - expectType>>(interaction.deferUpdate({ fetchReply: true })); + expectType>>(interaction.reply({ content: 'a', fetchResponse: true })); + expectType>>(interaction.deferReply({ fetchResponse: true })); + expectType>>(interaction.editResponse({ content: 'a' })); + expectType>>(interaction.fetchResponse()); + expectType>>(interaction.deferMessageUpdate({ fetchResponse: true })); expectType>>(interaction.followUp({ content: 'a' })); } else if (interaction.inRawGuild()) { expectAssignable(interaction); expectType(interaction.guild); - expectType>>(interaction.reply({ content: 'a', fetchReply: true })); - expectType>>(interaction.deferReply({ fetchReply: true })); - expectType>>(interaction.editReply({ content: 'a' })); - expectType>>(interaction.fetchReply()); - expectType>>(interaction.deferUpdate({ fetchReply: true })); + expectType>>(interaction.reply({ content: 'a', fetchResponse: true })); + expectType>>(interaction.deferReply({ fetchResponse: true })); + expectType>>(interaction.editResponse({ content: 'a' })); + expectType>>(interaction.fetchResponse()); + expectType>>(interaction.deferMessageUpdate({ fetchResponse: true })); expectType>>(interaction.followUp({ content: 'a' })); } else if (interaction.inGuild()) { expectAssignable(interaction); expectType(interaction.guild); - expectType>(interaction.reply({ content: 'a', fetchReply: true })); - expectType>(interaction.deferReply({ fetchReply: true })); - expectType>(interaction.editReply({ content: 'a' })); - expectType>(interaction.fetchReply()); - expectType>(interaction.deferUpdate({ fetchReply: true })); + expectType>(interaction.reply({ content: 'a', fetchResponse: true })); + expectType>(interaction.deferReply({ fetchResponse: true })); + expectType>(interaction.editResponse({ content: 'a' })); + expectType>(interaction.fetchResponse()); + expectType>(interaction.deferMessageUpdate({ fetchResponse: true })); expectType>(interaction.followUp({ content: 'a' })); } }