From 7e81d3b6c8f1cca7f39ee6ee161a771241964b83 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Sun, 12 Jan 2025 21:48:08 +0000 Subject: [PATCH] refactor!: Remove `InteractionResponse` (#10689) BREAKING CHANGE: `InteractionResponse` has been removed. Create interaction collectors via `with_response` or fetching the reply. --- packages/discord.js/src/index.js | 1 - .../src/structures/InteractionCollector.js | 36 +------ .../src/structures/InteractionResponse.js | 102 ------------------ packages/discord.js/src/structures/Message.js | 1 - .../interfaces/InteractionResponses.js | 25 ++--- packages/discord.js/typings/index.d.ts | 70 ++++++------ packages/discord.js/typings/index.test-d.ts | 71 ++++++++++++ 7 files changed, 118 insertions(+), 188 deletions(-) delete mode 100644 packages/discord.js/src/structures/InteractionResponse.js diff --git a/packages/discord.js/src/index.js b/packages/discord.js/src/index.js index d2f0ff799947..7fcbf2ce010c 100644 --- a/packages/discord.js/src/index.js +++ b/packages/discord.js/src/index.js @@ -148,7 +148,6 @@ exports.InteractionCallbackResource = require('./structures/InteractionCallbackR exports.InteractionCallbackResponse = require('./structures/InteractionCallbackResponse'); exports.BaseInteraction = require('./structures/BaseInteraction'); exports.InteractionCollector = require('./structures/InteractionCollector'); -exports.InteractionResponse = require('./structures/InteractionResponse'); exports.InteractionWebhook = require('./structures/InteractionWebhook'); exports.Invite = require('./structures/Invite'); exports.InviteGuild = require('./structures/InviteGuild'); diff --git a/packages/discord.js/src/structures/InteractionCollector.js b/packages/discord.js/src/structures/InteractionCollector.js index e0526951e74a..bd2efdcb626c 100644 --- a/packages/discord.js/src/structures/InteractionCollector.js +++ b/packages/discord.js/src/structures/InteractionCollector.js @@ -14,8 +14,6 @@ const Events = require('../util/Events'); * @property {number} [maxComponents] The maximum number of components to collect * @property {number} [maxUsers] The maximum number of users to interact * @property {Message|APIMessage} [message] The message to listen to interactions from - * @property {InteractionResponse} [interactionResponse] The interaction response to listen - * to message component interactions from */ /** @@ -40,30 +38,20 @@ class InteractionCollector extends Collector { * The message from which to collect interactions, if provided * @type {?Snowflake} */ - this.messageId = options.message?.id ?? options.interactionResponse?.interaction.message?.id ?? null; - - /** - * The message interaction id from which to collect interactions, if provided - * @type {?Snowflake} - */ - this.messageInteractionId = options.interactionResponse?.id ?? null; + this.messageId = options.message?.id ?? null; /** * The channel from which to collect interactions, if provided * @type {?Snowflake} */ this.channelId = - options.interactionResponse?.interaction.channelId ?? - options.message?.channelId ?? - options.message?.channel_id ?? - this.client.channels.resolveId(options.channel); + options.message?.channelId ?? options.message?.channel_id ?? this.client.channels.resolveId(options.channel); /** * The guild from which to collect interactions, if provided * @type {?Snowflake} */ this.guildId = - options.interactionResponse?.interaction.guildId ?? options.message?.guildId ?? options.message?.guild_id ?? this.client.guilds.resolveId(options.channel?.guild) ?? @@ -99,7 +87,7 @@ class InteractionCollector extends Collector { if (messages.has(this.messageId)) this.stop('messageDelete'); }; - if (this.messageId || this.messageInteractionId) { + if (this.messageId) { this._handleMessageDeletion = this._handleMessageDeletion.bind(this); this.client.on(Events.MessageDelete, this._handleMessageDeletion); this.client.on(Events.MessageBulkDelete, bulkDeleteListener); @@ -151,13 +139,6 @@ class InteractionCollector extends Collector { if (this.interactionType && interaction.type !== this.interactionType) return null; if (this.componentType && interaction.componentType !== this.componentType) return null; if (this.messageId && interaction.message?.id !== this.messageId) return null; - if ( - this.messageInteractionId && - interaction.message?.interactionMetadata?.id && - interaction.message.interactionMetadata.id !== this.messageInteractionId - ) { - return null; - } if (this.channelId && interaction.channelId !== this.channelId) return null; if (this.guildId && interaction.guildId !== this.guildId) return null; @@ -178,13 +159,6 @@ class InteractionCollector extends Collector { if (this.type && interaction.type !== this.type) return null; if (this.componentType && interaction.componentType !== this.componentType) return null; if (this.messageId && interaction.message?.id !== this.messageId) return null; - if ( - this.messageInteractionId && - interaction.message?.interactionMetadata?.id && - interaction.message.interactionMetadata.id !== this.messageInteractionId - ) { - return null; - } if (this.channelId && interaction.channelId !== this.channelId) return null; if (this.guildId && interaction.guildId !== this.guildId) return null; @@ -223,10 +197,6 @@ class InteractionCollector extends Collector { if (message.id === this.messageId) { this.stop('messageDelete'); } - - if (message.interactionMetadata?.id === this.messageInteractionId) { - this.stop('messageDelete'); - } } /** diff --git a/packages/discord.js/src/structures/InteractionResponse.js b/packages/discord.js/src/structures/InteractionResponse.js deleted file mode 100644 index 9b372e3932d6..000000000000 --- a/packages/discord.js/src/structures/InteractionResponse.js +++ /dev/null @@ -1,102 +0,0 @@ -'use strict'; - -const { DiscordSnowflake } = require('@sapphire/snowflake'); -const { InteractionType } = require('discord-api-types/v10'); -const { DiscordjsError, ErrorCodes } = require('../errors'); - -/** - * Represents an interaction's response - */ -class InteractionResponse { - constructor(interaction, id) { - /** - * The interaction associated with the interaction response - * @type {BaseInteraction} - */ - this.interaction = interaction; - /** - * The id of the original interaction response - * @type {Snowflake} - */ - this.id = id ?? interaction.id; - this.client = interaction.client; - } - - /** - * The timestamp the interaction response was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return DiscordSnowflake.timestampFrom(this.id); - } - - /** - * The time the interaction response was created at - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * Collects a single component interaction that passes the filter. - * The Promise will reject if the time expires. - * @param {AwaitMessageComponentOptions} [options={}] Options to pass to the internal collector - * @returns {Promise} - */ - awaitMessageComponent(options = {}) { - const _options = { ...options, max: 1 }; - return new Promise((resolve, reject) => { - const collector = this.createMessageComponentCollector(_options); - collector.once('end', (interactions, reason) => { - const interaction = interactions.first(); - if (interaction) resolve(interaction); - else reject(new DiscordjsError(ErrorCodes.InteractionCollectorError, reason)); - }); - }); - } - - /** - * Creates a message component interaction collector - * @param {MessageComponentCollectorOptions} [options={}] Options to send to the collector - * @returns {InteractionCollector} - */ - createMessageComponentCollector(options = {}) { - return new InteractionCollector(this.client, { - ...options, - interactionResponse: this, - interactionType: InteractionType.MessageComponent, - }); - } - - /** - * Fetches the response as a {@link Message} object. - * @returns {Promise} - */ - fetch() { - return this.interaction.fetchReply(); - } - - /** - * Deletes the response. - * @returns {Promise} - */ - delete() { - return this.interaction.deleteReply(); - } - - /** - * Edits the response. - * @param {string|MessagePayload|WebhookMessageEditOptions} options The new options for the response. - * @returns {Promise} - */ - edit(options) { - return this.interaction.editReply(options); - } -} - -// eslint-disable-next-line import/order -const InteractionCollector = require('./InteractionCollector'); -module.exports = InteractionResponse; diff --git a/packages/discord.js/src/structures/Message.js b/packages/discord.js/src/structures/Message.js index 4c130a091dd7..9fb192c2243d 100644 --- a/packages/discord.js/src/structures/Message.js +++ b/packages/discord.js/src/structures/Message.js @@ -644,7 +644,6 @@ class Message extends Base { * @property {ComponentType} [componentType] The type of component interaction to collect * @property {number} [idle] Time to wait without another message component interaction before ending the collector * @property {boolean} [dispose] Whether to remove the message component interaction after collecting - * @property {InteractionResponse} [interactionResponse] The interaction response to collect interactions from */ /** diff --git a/packages/discord.js/src/structures/interfaces/InteractionResponses.js b/packages/discord.js/src/structures/interfaces/InteractionResponses.js index 899ef64743fd..947665232353 100644 --- a/packages/discord.js/src/structures/interfaces/InteractionResponses.js +++ b/packages/discord.js/src/structures/interfaces/InteractionResponses.js @@ -7,7 +7,6 @@ const { DiscordjsError, ErrorCodes } = require('../../errors'); const MessageFlagsBitField = require('../../util/MessageFlagsBitField'); const InteractionCallbackResponse = require('../InteractionCallbackResponse'); const InteractionCollector = require('../InteractionCollector'); -const InteractionResponse = require('../InteractionResponse'); const MessagePayload = require('../MessagePayload'); /** @@ -61,7 +60,7 @@ class InteractionResponses { /** * Defers the reply to this interaction. * @param {InteractionDeferReplyOptions} [options] Options for deferring the reply to this interaction - * @returns {Promise} + * @returns {Promise} * @example * // Defer the reply to this interaction * interaction.deferReply() @@ -92,16 +91,14 @@ class InteractionResponses { this.deferred = true; this.ephemeral = resolvedFlags.has(MessageFlags.Ephemeral); - return options.withResponse - ? new InteractionCallbackResponse(this.client, response) - : new InteractionResponse(this); + return options.withResponse ? new InteractionCallbackResponse(this.client, response) : undefined; } /** * Creates a reply to this interaction. * Use the `withResponse` option to get the interaction callback response. * @param {string|MessagePayload|InteractionReplyOptions} options The options for the reply - * @returns {Promise} + * @returns {Promise} * @example * // Reply to the interaction and fetch the response * interaction.reply({ content: 'Pong!', withResponse: true }) @@ -137,9 +134,7 @@ class InteractionResponses { this.ephemeral = Boolean(data.flags & MessageFlags.Ephemeral); this.replied = true; - return options.withResponse - ? new InteractionCallbackResponse(this.client, response) - : new InteractionResponse(this); + return options.withResponse ? new InteractionCallbackResponse(this.client, response) : undefined; } /** @@ -211,7 +206,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 - * @returns {Promise} + * @returns {Promise} * @example * // Defer updating and reset the component's loading state * interaction.deferUpdate() @@ -229,15 +224,13 @@ class InteractionResponses { }); this.deferred = true; - return options.withResponse - ? new InteractionCallbackResponse(this.client, response) - : new InteractionResponse(this, this.message?.interactionMetadata?.id); + return options.withResponse ? new InteractionCallbackResponse(this.client, response) : undefined; } /** * 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 - * @returns {Promise} + * @returns {Promise} * @example * // Remove the components from the message * interaction.update({ @@ -267,9 +260,7 @@ class InteractionResponses { }); this.replied = true; - return options.withResponse - ? new InteractionCallbackResponse(this.client, response) - : new InteractionResponse(this, this.message.interactionMetadata?.id); + return options.withResponse ? new InteractionCallbackResponse(this.client, response) : undefined; } /** diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 43e923455079..c1beb5bc1d04 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -568,7 +568,8 @@ export abstract class CommandInteraction e public deferReply( options: InteractionDeferReplyOptions & { withResponse: true }, ): Promise; - public deferReply(options?: InteractionDeferReplyOptions): Promise>>; + public deferReply(options?: InteractionDeferReplyOptions & { withResponse: false }): Promise; + public deferReply(options?: InteractionDeferReplyOptions): Promise; public deleteReply(message?: MessageResolvable | '@original'): Promise; public editReply( options: string | MessagePayload | InteractionEditReplyOptions, @@ -576,9 +577,10 @@ export abstract class CommandInteraction e public fetchReply(message?: Snowflake | '@original'): Promise>>; public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise>>; public reply(options: InteractionReplyOptions & { withResponse: true }): Promise; + public reply(options: InteractionReplyOptions & { withResponse: false }): Promise; public reply( options: string | MessagePayload | InteractionReplyOptions, - ): Promise>>; + ): Promise; public showModal( modal: | JSONEncodable @@ -591,8 +593,15 @@ export abstract class CommandInteraction e | JSONEncodable | ModalComponentData | APIModalInteractionResponseCallbackData, - options?: ShowModalOptions, + options?: ShowModalOptions & { withResponse: false }, ): Promise; + public showModal( + modal: + | JSONEncodable + | ModalComponentData + | APIModalInteractionResponseCallbackData, + options?: ShowModalOptions, + ): Promise; public awaitModalSubmit( options: AwaitModalSubmitOptions, ): Promise>; @@ -602,24 +611,6 @@ export abstract class CommandInteraction e ): CommandInteractionOption; } -export class InteractionResponse { - private constructor(interaction: Interaction, id?: Snowflake); - public interaction: Interaction>; - public client: Client; - public id: Snowflake; - public get createdAt(): Date; - public get createdTimestamp(): number; - public awaitMessageComponent( - options?: AwaitMessageCollectorOptionsParams, - ): Promise[ComponentType]>; - public createMessageComponentCollector( - options?: MessageCollectorOptionsParams, - ): InteractionCollector[ComponentType]>; - public delete(): Promise; - public edit(options: string | MessagePayload | WebhookMessageEditOptions): Promise; - public fetch(): Promise; -} - export abstract class BaseGuild extends Base { protected constructor(client: Client, data: RawBaseGuildData); public get createdAt(): Date; @@ -2033,7 +2024,6 @@ export class InteractionCollector exte private _handleGuildDeletion(guild: Guild): void; public channelId: Snowflake | null; - public messageInteractionId: Snowflake | null; public componentType: ComponentType | null; public guildId: Snowflake | null; public interactionType: InteractionType | null; @@ -2337,11 +2327,13 @@ export class MessageComponentInteraction e public deferReply( options: InteractionDeferReplyOptions & { withResponse: true }, ): Promise; - public deferReply(options?: InteractionDeferReplyOptions): Promise>>; + public deferReply(options?: InteractionDeferReplyOptions & { withResponse: false }): Promise; + public deferReply(options?: InteractionDeferReplyOptions): Promise; public deferUpdate( options: InteractionDeferUpdateOptions & { withResponse: true }, ): Promise; - public deferUpdate(options?: InteractionDeferUpdateOptions): Promise>>; + public deferUpdate(options?: InteractionDeferUpdateOptions & { withResponse: false }): Promise; + public deferUpdate(options?: InteractionDeferUpdateOptions): Promise; public deleteReply(message?: MessageResolvable | '@original'): Promise; public editReply( options: string | MessagePayload | InteractionEditReplyOptions, @@ -2349,13 +2341,15 @@ export class MessageComponentInteraction e public fetchReply(message?: Snowflake | '@original'): Promise>>; public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise>>; public reply(options: InteractionReplyOptions & { withResponse: true }): Promise; + public reply(options: InteractionReplyOptions & { withResponse: false }): Promise; public reply( options: string | MessagePayload | InteractionReplyOptions, - ): Promise>>; + ): Promise; public update(options: InteractionUpdateOptions & { withResponse: true }): Promise; + public update(options: InteractionUpdateOptions & { withResponse: false }): Promise; public update( options: string | MessagePayload | InteractionUpdateOptions, - ): Promise>>; + ): Promise; public showModal( modal: | JSONEncodable @@ -2368,8 +2362,15 @@ export class MessageComponentInteraction e | JSONEncodable | ModalComponentData | APIModalInteractionResponseCallbackData, - options?: ShowModalOptions, + options?: ShowModalOptions & { withResponse: false }, ): Promise; + public showModal( + modal: + | JSONEncodable + | ModalComponentData + | APIModalInteractionResponseCallbackData, + options?: ShowModalOptions, + ): Promise; public awaitModalSubmit( options: AwaitModalSubmitOptions, ): Promise>; @@ -2538,9 +2539,8 @@ export interface ModalMessageModalSubmitInteraction>; channelId: Snowflake; update(options: InteractionUpdateOptions & { withResponse: true }): Promise; - update( - options: string | MessagePayload | InteractionUpdateOptions, - ): Promise>>; + update(options: InteractionUpdateOptions & { withResponse: false }): Promise; + update(options: string | MessagePayload | InteractionUpdateOptions): Promise; inGuild(): this is ModalMessageModalSubmitInteraction<'raw' | 'cached'>; inCachedGuild(): this is ModalMessageModalSubmitInteraction<'cached'>; inRawGuild(): this is ModalMessageModalSubmitInteraction<'raw'>; @@ -2558,9 +2558,10 @@ export class ModalSubmitInteraction extend public replied: boolean; public readonly webhook: InteractionWebhook; public reply(options: InteractionReplyOptions & { withResponse: true }): Promise; + public reply(options: InteractionReplyOptions & { withResponse: false }): Promise; public reply( options: string | MessagePayload | InteractionReplyOptions, - ): Promise>>; + ): Promise; public deleteReply(message?: MessageResolvable | '@original'): Promise; public editReply( options: string | MessagePayload | InteractionEditReplyOptions, @@ -2568,13 +2569,15 @@ export class ModalSubmitInteraction extend public deferReply( options: InteractionDeferReplyOptions & { withResponse: true }, ): Promise; - public deferReply(options?: InteractionDeferReplyOptions): Promise>>; + public deferReply(options?: InteractionDeferReplyOptions & { withResponse: false }): Promise; + public deferReply(options?: InteractionDeferReplyOptions): Promise; public fetchReply(message?: Snowflake | '@original'): Promise>>; public followUp(options: string | MessagePayload | InteractionReplyOptions): Promise>>; public deferUpdate( options: InteractionDeferUpdateOptions & { withResponse: true }, ): Promise; - public deferUpdate(options?: InteractionDeferUpdateOptions): Promise>>; + public deferUpdate(options?: InteractionDeferUpdateOptions & { withResponse: false }): Promise; + public deferUpdate(options?: InteractionDeferUpdateOptions): Promise; public inGuild(): this is ModalSubmitInteraction<'raw' | 'cached'>; public inCachedGuild(): this is ModalSubmitInteraction<'cached'>; public inRawGuild(): this is ModalSubmitInteraction<'raw'>; @@ -6213,7 +6216,6 @@ export interface InteractionCollectorOptions< maxComponents?: number; maxUsers?: number; message?: CacheTypeReducer; - interactionResponse?: InteractionResponse>; } export interface InteractionDeferReplyOptions { diff --git a/packages/discord.js/typings/index.test-d.ts b/packages/discord.js/typings/index.test-d.ts index 760954ad73a5..a88921b5f7a9 100644 --- a/packages/discord.js/typings/index.test-d.ts +++ b/packages/discord.js/typings/index.test-d.ts @@ -1791,10 +1791,20 @@ client.on('interactionCreate', async interaction => { expectType(interaction.guild); expectType>(interaction.reply({ content: 'a', withResponse: true })); expectType>(interaction.deferReply({ withResponse: true })); + expectType>(interaction.deferReply()); + expectType>(interaction.reply({ content: 'a', withResponse: false })); + expectType>(interaction.deferReply({ withResponse: false })); + expectType>( + interaction.reply({ content: 'a', withResponse: booleanValue }), + ); + expectType>( + interaction.deferReply({ withResponse: booleanValue }), + ); expectType>>(interaction.editReply({ content: 'a' })); expectType>>(interaction.fetchReply()); expectType>(interaction.update({ content: 'a', withResponse: true })); expectType>(interaction.deferUpdate({ withResponse: true })); + expectType>(interaction.deferUpdate()); expectType>>(interaction.followUp({ content: 'a' })); } else if (interaction.inRawGuild()) { expectAssignable(interaction); @@ -1803,10 +1813,24 @@ client.on('interactionCreate', async interaction => { expectType(interaction.guild); expectType>(interaction.reply({ content: 'a', withResponse: true })); expectType>(interaction.deferReply({ withResponse: true })); + expectType>(interaction.reply({ content: 'a', withResponse: false })); + expectType>(interaction.deferReply({ withResponse: false })); + expectType>(interaction.deferReply()); + expectType>( + interaction.reply({ content: 'a', withResponse: booleanValue }), + ); + expectType>( + interaction.deferReply({ withResponse: booleanValue }), + ); expectType>>(interaction.editReply({ content: 'a' })); expectType>>(interaction.fetchReply()); expectType>(interaction.update({ content: 'a', withResponse: true })); + expectType>(interaction.update({ content: 'a', withResponse: false })); + expectType>( + interaction.update({ content: 'a', withResponse: booleanValue }), + ); expectType>(interaction.deferUpdate({ withResponse: true })); + expectType>(interaction.deferUpdate()); expectType>>(interaction.followUp({ content: 'a' })); } else if (interaction.inGuild()) { expectAssignable(interaction); @@ -1815,10 +1839,24 @@ client.on('interactionCreate', async interaction => { expectType(interaction.guild); expectType>(interaction.reply({ content: 'a', withResponse: true })); expectType>(interaction.deferReply({ withResponse: true })); + expectType>(interaction.reply({ content: 'a', withResponse: false })); + expectType>(interaction.deferReply({ withResponse: false })); + expectType>(interaction.deferReply()); + expectType>( + interaction.reply({ content: 'a', withResponse: booleanValue }), + ); + expectType>( + interaction.deferReply({ withResponse: booleanValue }), + ); expectType>(interaction.editReply({ content: 'a' })); expectType>(interaction.fetchReply()); expectType>(interaction.update({ content: 'a', withResponse: true })); + expectType>(interaction.update({ content: 'a', withResponse: false })); + expectType>( + interaction.update({ content: 'a', withResponse: booleanValue }), + ); expectType>(interaction.deferUpdate({ withResponse: true })); + expectType>(interaction.deferUpdate()); expectType>(interaction.followUp({ content: 'a' })); } } @@ -1854,6 +1892,15 @@ client.on('interactionCreate', async interaction => { expectAssignable>(interaction); expectType>(interaction.reply({ content: 'a', withResponse: true })); expectType>(interaction.deferReply({ withResponse: true })); + expectType>(interaction.deferReply()); + expectType>(interaction.reply({ content: 'a', withResponse: false })); + expectType>(interaction.deferReply({ withResponse: false })); + expectType>( + interaction.reply({ content: 'a', withResponse: booleanValue }), + ); + expectType>( + interaction.deferReply({ withResponse: booleanValue }), + ); expectType>>(interaction.editReply({ content: 'a' })); expectType>>(interaction.fetchReply()); expectType>>(interaction.followUp({ content: 'a' })); @@ -1862,6 +1909,15 @@ client.on('interactionCreate', async interaction => { expectType(interaction.guild); expectType>(interaction.reply({ content: 'a', withResponse: true })); expectType>(interaction.deferReply({ withResponse: true })); + expectType>(interaction.deferReply()); + expectType>(interaction.reply({ content: 'a', withResponse: false })); + expectType>(interaction.deferReply({ withResponse: false })); + expectType>( + interaction.reply({ content: 'a', withResponse: booleanValue }), + ); + expectType>( + interaction.deferReply({ withResponse: booleanValue }), + ); expectType>>(interaction.editReply({ content: 'a' })); expectType>>(interaction.fetchReply()); expectType>>(interaction.followUp({ content: 'a' })); @@ -1870,6 +1926,15 @@ client.on('interactionCreate', async interaction => { expectType(interaction.guild); expectType>(interaction.reply({ content: 'a', withResponse: true })); expectType>(interaction.deferReply({ withResponse: true })); + expectType>(interaction.deferReply()); + expectType>(interaction.reply({ content: 'a', withResponse: false })); + expectType>(interaction.deferReply({ withResponse: false })); + expectType>( + interaction.reply({ content: 'a', withResponse: booleanValue }), + ); + expectType>( + interaction.deferReply({ withResponse: booleanValue }), + ); expectType>(interaction.editReply({ content: 'a' })); expectType>(interaction.fetchReply()); expectType>(interaction.followUp({ content: 'a' })); @@ -2063,27 +2128,33 @@ client.on('interactionCreate', async interaction => { expectType(interaction.guild); expectType>(interaction.reply({ content: 'a', withResponse: true })); expectType>(interaction.deferReply({ withResponse: true })); + expectType>(interaction.deferReply()); expectType>>(interaction.editReply({ content: 'a' })); expectType>>(interaction.fetchReply()); expectType>(interaction.deferUpdate({ withResponse: true })); + expectType>(interaction.deferUpdate()); expectType>>(interaction.followUp({ content: 'a' })); } else if (interaction.inRawGuild()) { expectAssignable(interaction); expectType(interaction.guild); expectType>(interaction.reply({ content: 'a', withResponse: true })); expectType>(interaction.deferReply({ withResponse: true })); + expectType>(interaction.deferReply()); expectType>>(interaction.editReply({ content: 'a' })); expectType>>(interaction.fetchReply()); expectType>(interaction.deferUpdate({ withResponse: true })); + expectType>(interaction.deferUpdate()); expectType>>(interaction.followUp({ content: 'a' })); } else if (interaction.inGuild()) { expectAssignable(interaction); expectType(interaction.guild); expectType>(interaction.reply({ content: 'a', withResponse: true })); expectType>(interaction.deferReply({ withResponse: true })); + expectType>(interaction.deferReply()); expectType>(interaction.editReply({ content: 'a' })); expectType>(interaction.fetchReply()); expectType>(interaction.deferUpdate({ withResponse: true })); + expectType>(interaction.deferUpdate()); expectType>(interaction.followUp({ content: 'a' })); } }