export declare class WebhooksAPI export declare class WebhooksAPI No summary provided.
constructor(rest)
Constructs a new instance of the 
WebhooksAPI class| Name | Type | Optional | Description | 
|---|---|---|---|
| rest | REST | No | None | 
create(channelId, body, { reason, signal }?)
:
Promise<never>
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 | 
delete(id, { token, reason, signal }?)
:
Promise<void>
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 | 
deleteMessage(id, token, messageId, query?, { signal }?)
:
Promise<void>
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 | 
edit(id, body, { token, reason, signal }?)
:
Promise<APIWebhook>
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<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 | 
execute(id, token, body, options?)
:
Promise<RESTPostAPIWebhookWithTokenWaitResult>
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 | 
execute(id, token, body, options?)
:
Promise<void>
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 | 
executeGitHub(id, token, body, query?, { signal }?)
:
Promise<void>
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 | 
executeSlack(id, token, body, query?, { signal }?)
:
Promise<void>
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 | 
get(id, token?, { signal }?)
:
Promise<APIWebhook>
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<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 |