diff --git a/packages/core/src/api/interactions.ts b/packages/core/src/api/interactions.ts index c28ba13c6baa..30e53ece8093 100644 --- a/packages/core/src/api/interactions.ts +++ b/packages/core/src/api/interactions.ts @@ -6,6 +6,7 @@ import type { APIInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTGetAPIWebhookWithTokenMessageResult, + APIInteractionResponseDeferredChannelMessageWithSource, } from 'discord-api-types/v10'; import type { WebhooksAPI } from './webhook.js'; @@ -41,12 +42,18 @@ export class InteractionsAPI { * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response} * @param interactionId - The id of the interaction * @param interactionToken - The token of the interaction + * @param data - The data to use when deferring the reply */ - public async defer(interactionId: Snowflake, interactionToken: string) { + public async defer( + interactionId: Snowflake, + interactionToken: string, + data?: APIInteractionResponseDeferredChannelMessageWithSource['data'], + ) { await this.rest.post(Routes.interactionCallback(interactionId, interactionToken), { auth: false, body: { type: InteractionResponseType.DeferredChannelMessageWithSource, + data, }, }); }