From 1fd587c9357ec1e3f3c15142d47283a3d40e3965 Mon Sep 17 00:00:00 2001 From: Naiyar <137700126+imnaiyar@users.noreply.github.com> Date: Tue, 14 Jan 2025 20:16:33 +0600 Subject: [PATCH] types: Allow only ephemeral for defer reply (#10696) * fix(types): remove unusable flags from InteractionDeferReplyOptions * fix: include flags in WebhookMessageEditOptions * chore: update jsdoc * fix: wrong order * chore: specify the flag * chore: extend MessageEditOptions --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --- packages/discord.js/src/structures/Webhook.js | 3 +-- packages/discord.js/typings/index.d.ts | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/discord.js/src/structures/Webhook.js b/packages/discord.js/src/structures/Webhook.js index b8302454a..e9e6cbcaa 100644 --- a/packages/discord.js/src/structures/Webhook.js +++ b/packages/discord.js/src/structures/Webhook.js @@ -141,8 +141,7 @@ class Webhook { /** * Options that can be passed into editMessage. - * @typedef {BaseMessageOptions} WebhookMessageEditOptions - * @property {Attachment[]} [attachments] Attachments to send with the message + * @typedef {MessageEditOptions} WebhookMessageEditOptions * @property {Snowflake} [threadId] The id of the thread this message belongs to * For interaction webhooks, this property is ignored */ diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index ab1590c74..56deac2a6 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -6184,10 +6184,7 @@ export interface InteractionCollectorOptions< } export interface InteractionDeferReplyOptions { - flags?: BitFieldResolvable< - Extract, - MessageFlags.Ephemeral | MessageFlags.SuppressEmbeds | MessageFlags.SuppressNotifications - >; + flags?: BitFieldResolvable, MessageFlags.Ephemeral>; withResponse?: boolean; } @@ -6910,7 +6907,7 @@ export interface WebhookEditOptions { reason?: string; } -export interface WebhookMessageEditOptions extends Omit { +export interface WebhookMessageEditOptions extends MessageEditOptions { threadId?: Snowflake; }