mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
feat(webhook): Support with_components (#10945)
feat: support `with_components`
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
type RESTPatchAPIWebhookJSONBody,
|
type RESTPatchAPIWebhookJSONBody,
|
||||||
type RESTPatchAPIWebhookResult,
|
type RESTPatchAPIWebhookResult,
|
||||||
type RESTPatchAPIWebhookWithTokenMessageJSONBody,
|
type RESTPatchAPIWebhookWithTokenMessageJSONBody,
|
||||||
|
type RESTPatchAPIWebhookWithTokenMessageQuery,
|
||||||
type RESTPatchAPIWebhookWithTokenMessageResult,
|
type RESTPatchAPIWebhookWithTokenMessageResult,
|
||||||
type RESTPostAPIWebhookWithTokenGitHubQuery,
|
type RESTPostAPIWebhookWithTokenGitHubQuery,
|
||||||
type RESTPostAPIWebhookWithTokenJSONBody,
|
type RESTPostAPIWebhookWithTokenJSONBody,
|
||||||
@@ -127,13 +128,14 @@ export class WebhooksAPI {
|
|||||||
{
|
{
|
||||||
wait,
|
wait,
|
||||||
thread_id,
|
thread_id,
|
||||||
|
with_components,
|
||||||
files,
|
files,
|
||||||
...body
|
...body
|
||||||
}: RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files?: RawFile[] },
|
}: RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files?: RawFile[] },
|
||||||
{ signal }: Pick<RequestData, 'signal'> = {},
|
{ signal }: Pick<RequestData, 'signal'> = {},
|
||||||
) {
|
) {
|
||||||
return this.rest.post(Routes.webhook(id, token), {
|
return this.rest.post(Routes.webhook(id, token), {
|
||||||
query: makeURLSearchParams({ wait, thread_id }),
|
query: makeURLSearchParams({ wait, thread_id, with_components }),
|
||||||
files,
|
files,
|
||||||
body,
|
body,
|
||||||
auth: false,
|
auth: false,
|
||||||
@@ -232,13 +234,14 @@ export class WebhooksAPI {
|
|||||||
messageId: Snowflake,
|
messageId: Snowflake,
|
||||||
{
|
{
|
||||||
thread_id,
|
thread_id,
|
||||||
|
with_components,
|
||||||
files,
|
files,
|
||||||
...body
|
...body
|
||||||
}: RESTPatchAPIWebhookWithTokenMessageJSONBody & { files?: RawFile[]; thread_id?: string },
|
}: RESTPatchAPIWebhookWithTokenMessageJSONBody & RESTPatchAPIWebhookWithTokenMessageQuery & { files?: RawFile[] },
|
||||||
{ signal }: Pick<RequestData, 'signal'> = {},
|
{ signal }: Pick<RequestData, 'signal'> = {},
|
||||||
) {
|
) {
|
||||||
return this.rest.patch(Routes.webhookMessage(id, token, messageId), {
|
return this.rest.patch(Routes.webhookMessage(id, token, messageId), {
|
||||||
query: makeURLSearchParams({ thread_id }),
|
query: makeURLSearchParams({ thread_id, with_components }),
|
||||||
auth: false,
|
auth: false,
|
||||||
body,
|
body,
|
||||||
signal,
|
signal,
|
||||||
|
|||||||
Reference in New Issue
Block a user