Skip to content

Commit 7713627

Browse files
committed
feat(webhook): Support with_components (#10945)
feat: support `with_components`
1 parent 6a5c0fb commit 7713627

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/core/src/api/webhook.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
type RESTPatchAPIWebhookJSONBody,
1010
type RESTPatchAPIWebhookResult,
1111
type RESTPatchAPIWebhookWithTokenMessageJSONBody,
12+
type RESTPatchAPIWebhookWithTokenMessageQuery,
1213
type RESTPatchAPIWebhookWithTokenMessageResult,
1314
type RESTPostAPIWebhookWithTokenGitHubQuery,
1415
type RESTPostAPIWebhookWithTokenJSONBody,
@@ -127,13 +128,14 @@ export class WebhooksAPI {
127128
{
128129
wait,
129130
thread_id,
131+
with_components,
130132
files,
131133
...body
132134
}: RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files?: RawFile[] },
133135
{ signal }: Pick<RequestData, 'signal'> = {},
134136
) {
135137
return this.rest.post(Routes.webhook(id, token), {
136-
query: makeURLSearchParams({ wait, thread_id }),
138+
query: makeURLSearchParams({ wait, thread_id, with_components }),
137139
files,
138140
body,
139141
auth: false,
@@ -232,13 +234,14 @@ export class WebhooksAPI {
232234
messageId: Snowflake,
233235
{
234236
thread_id,
237+
with_components,
235238
files,
236239
...body
237-
}: RESTPatchAPIWebhookWithTokenMessageJSONBody & { files?: RawFile[]; thread_id?: string },
240+
}: RESTPatchAPIWebhookWithTokenMessageJSONBody & RESTPatchAPIWebhookWithTokenMessageQuery & { files?: RawFile[] },
238241
{ signal }: Pick<RequestData, 'signal'> = {},
239242
) {
240243
return this.rest.patch(Routes.webhookMessage(id, token, messageId), {
241-
query: makeURLSearchParams({ thread_id }),
244+
query: makeURLSearchParams({ thread_id, with_components }),
242245
auth: false,
243246
body,
244247
signal,

0 commit comments

Comments
 (0)