WebhooksAPI
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 |
| data | RESTPostAPIChannelWebhookJSONBody | No | The data to use when creating the webhook |
| reason | string | Yes | The reason for creating the webhook |
Deletes a webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook to delete |
| options | { reason?: string; token?: string; } | Yes | The options to use when deleting the webhook |
Deletes an associated message from a webhook
Edits a webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook to edit |
| webhook | RESTPatchAPIWebhookJSONBody | No | The new webhook data |
| options | { reason?: string; token?: string; } | Yes | The options to use when editing the webhook |
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 |
| data | RESTPatchAPIWebhookWithTokenMessageJSONBody & { thread_id?: string; } | No | The data to use when editing the message |
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 |
| data | RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files?: RawFile[]; wait: true; } | No | The data 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 |
| options | unknown | No | The options to use when executing the webhook |
| options | RESTPostAPIWebhookWithTokenGitHubQuery | Yes | The options to use when executing the webhook |
Executes a slack webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook |
| token | string | No | The token of the webhook |
| options | unknown | No | The options to use when executing the webhook |
| options | RESTPostAPIWebhookWithTokenSlackQuery | Yes | The options to use when executing the webhook |
Fetches a webhook
| Name | Type | Optional | Description |
|---|---|---|---|
| id | Snowflake | No | The id of the webhook |
| token | string | Yes | The token of the webhook |