No summary provided.
constructor(rest)
Constructs a new instance of the
WebhooksAPI class| Name | Type | Optional | Description |
|---|---|---|---|
| rest | REST | No | None |
Creates a new webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to create the webhook in |
| body | RESTPostAPIChannelWebhookJSONBody | No | The data to use when creating the webhook |
| { reason, signal } | Pick<RequestData, 'reason' | 'signal'> | Yes | None |
Deletes a webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook to delete |
| { token, reason, signal } | Pick<RequestData, 'reason' | 'signal'> & { token?: string | undefined; } | Yes | None |
Deletes an associated message from a webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook |
| token | string | No | The token of the webhook |
| messageId | Snowflake | No | The id of the message to delete |
| query | { thread_id?: string; } | Yes | The options to use when deleting the message |
| { signal } | Pick<RequestData, 'signal'> | Yes | None |
Edits a webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook to edit |
| body | RESTPatchAPIWebhookJSONBody | No | The new webhook data |
| { token, reason, signal } | Pick<RequestData, 'reason' | 'signal'> & { token?: string | undefined; } | Yes | None |
editMessage(id, token, messageId, { thread_id, files, ...body }, { signal }?)
:
Promise<import("discord-api-types/v10").APIMessage>
Edits an associated message from a webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook |
| token | string | No | The token of the webhook |
| messageId | Snowflake | No | The id of the message to edit |
| { thread_id, files, ...body } | RESTPatchAPIWebhookWithTokenMessageJSONBody & { files?: RawFile[]; thread_id?: string; } | No | None |
| { signal } | Pick<RequestData, 'signal'> | Yes | None |
Executes a webhook and returns the created message
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook |
| token | string | No | The token of the webhook |
| body | RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files?: RawFile[]; wait: true; } | No | The data to use when executing the webhook |
| options | Pick<RequestData, 'signal'> | Yes | The options to use when executing the webhook |
Executes a webhook and returns the created message
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook |
| token | string | No | The token of the webhook |
| body | RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files?: RawFile[]; wait: true; } | No | The data to use when executing the webhook |
| options | Pick<RequestData, 'signal'> | Yes | The options to use when executing the webhook |
Executes a github webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook |
| token | string | No | The token of the webhook |
| body | unknown | No | None |
| query | RESTPostAPIWebhookWithTokenGitHubQuery | Yes | The options to use when executing the webhook |
| { signal } | Pick<RequestData, 'signal'> | Yes | None |
Executes a slack webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook |
| token | string | No | The token of the webhook |
| body | unknown | No | None |
| query | RESTPostAPIWebhookWithTokenSlackQuery | Yes | The query options to use when executing the webhook |
| { signal } | Pick<RequestData, 'signal'> | Yes | None |
Fetches a webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook |
| token | string | Yes | The token of the webhook |
| { signal } | Pick<RequestData, 'signal'> | Yes | None |
getMessage(id, token, messageId, query?, { signal }?)
:
Promise<import("discord-api-types/v10").APIMessage>
Fetches an associated message from a webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook |
| token | string | No | The token of the webhook |
| messageId | Snowflake | No | The id of the message to fetch |
| query | RESTGetAPIWebhookWithTokenMessageQuery | Yes | The query options to use when fetching the message |
| { signal } | Pick<RequestData, 'signal'> | Yes | None |