From 7713627fd18599a6187b325e1e4bc9a17cf23e21 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Sun, 22 Jun 2025 10:42:01 +0100 Subject: [PATCH] feat(webhook): Support `with_components` (#10945) feat: support `with_components` --- packages/core/src/api/webhook.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/core/src/api/webhook.ts b/packages/core/src/api/webhook.ts index d54253c25..38dc91412 100644 --- a/packages/core/src/api/webhook.ts +++ b/packages/core/src/api/webhook.ts @@ -9,6 +9,7 @@ import { type RESTPatchAPIWebhookJSONBody, type RESTPatchAPIWebhookResult, type RESTPatchAPIWebhookWithTokenMessageJSONBody, + type RESTPatchAPIWebhookWithTokenMessageQuery, type RESTPatchAPIWebhookWithTokenMessageResult, type RESTPostAPIWebhookWithTokenGitHubQuery, type RESTPostAPIWebhookWithTokenJSONBody, @@ -127,13 +128,14 @@ export class WebhooksAPI { { wait, thread_id, + with_components, files, ...body }: RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files?: RawFile[] }, { signal }: Pick = {}, ) { return this.rest.post(Routes.webhook(id, token), { - query: makeURLSearchParams({ wait, thread_id }), + query: makeURLSearchParams({ wait, thread_id, with_components }), files, body, auth: false, @@ -232,13 +234,14 @@ export class WebhooksAPI { messageId: Snowflake, { thread_id, + with_components, files, ...body - }: RESTPatchAPIWebhookWithTokenMessageJSONBody & { files?: RawFile[]; thread_id?: string }, + }: RESTPatchAPIWebhookWithTokenMessageJSONBody & RESTPatchAPIWebhookWithTokenMessageQuery & { files?: RawFile[] }, { signal }: Pick = {}, ) { return this.rest.patch(Routes.webhookMessage(id, token, messageId), { - query: makeURLSearchParams({ thread_id }), + query: makeURLSearchParams({ thread_id, with_components }), auth: false, body, signal,