yor.ts / Exports / WebhookClient
Name | Type |
---|---|
T | extends string | { id : string ; token : string } |
• new WebhookClient<T
>(options
): WebhookClient
<T
>
Creates a new WebhookClient instance.
Name | Type |
---|---|
T | extends string | { id : string ; token : string } |
Name | Type | Description |
---|---|---|
options | T | The options for the WebhookClient. |
src/structures/WebhookClient.ts:29
• Private
API: WebhooksAPI
src/structures/WebhookClient.ts:22
• Readonly
id: string
src/structures/WebhookClient.ts:19
• Readonly
token: string
src/structures/WebhookClient.ts:20
▸ delete(reason
): Promise
<void
>
Deletes the resource with the given reason.
Name | Type | Description |
---|---|---|
reason | string | The reason for deleting the resource. |
Promise
<void
>
A promise that resolves with the result of the deletion operation.
src/structures/WebhookClient.ts:71
▸ deleteMessage(messageId
, options?
): Promise
<void
>
Deletes a webhook message.
Name | Type | Description |
---|---|---|
messageId | string | The ID of the message to delete. |
options? | Object | The query parameters to send with the request. |
options.thread_id | string | - |
Promise
<void
>
A promise that resolves once the message is deleted.
src/structures/WebhookClient.ts:115
▸ edit(data
): Promise
<APIWebhook
>
Edits the webhook with the provided data.
Name | Type | Description |
---|---|---|
data | RESTPatchAPIWebhookJSONBody & { reason : string } | The data to edit the webhook with, including the reason. |
Promise
<APIWebhook
>
A promise that resolves to the edited webhook.
src/structures/WebhookClient.ts:58
▸ editMessage(messageId
, data
): Promise
<APIMessage
>
Edits a previously sent webhook message.
Name | Type | Description |
---|---|---|
messageId | string | The ID of the message to edit. |
data | RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files? : RawFile [] } | The new data for the message. |
Promise
<APIMessage
>
A promise that resolves to the edited message.
src/structures/WebhookClient.ts:98
▸ fetchMessage(messageId
, query?
): Promise
<APIMessage
>
Fetches a message that was created by the webhook.
Name | Type | Description |
---|---|---|
messageId | string | The ID of the message to fetch. |
query? | RESTGetAPIWebhookWithTokenMessageQuery | The query parameters to send with the request. |
Promise
<APIMessage
>
A promise that resolves to the fetched message.
src/structures/WebhookClient.ts:129
▸ send(data
): Promise
<APIMessage
>
Sends the provided data using the API’s execute
method.
Name | Type | Description |
---|---|---|
data | RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files? : RawFile [] ; wait : true } | The data to be sent. |
Promise
<APIMessage
>
A promise that resolves to the result of the execute
method.
src/structures/WebhookClient.ts:81
yor.ts / Exports / WebhookClient
Name | Type |
---|---|
T | extends string | { id : string ; token : string } |
• new WebhookClient<T
>(options
): WebhookClient
<T
>
Creates a new WebhookClient instance.
Name | Type |
---|---|
T | extends string | { id : string ; token : string } |
Name | Type | Description |
---|---|---|
options | T | The options for the WebhookClient. |
src/structures/WebhookClient.ts:29
• Private
API: WebhooksAPI
src/structures/WebhookClient.ts:22
• Readonly
id: string
src/structures/WebhookClient.ts:19
• Readonly
token: string
src/structures/WebhookClient.ts:20
▸ delete(reason
): Promise
<void
>
Deletes the resource with the given reason.
Name | Type | Description |
---|---|---|
reason | string | The reason for deleting the resource. |
Promise
<void
>
A promise that resolves with the result of the deletion operation.
src/structures/WebhookClient.ts:71
▸ deleteMessage(messageId
, options?
): Promise
<void
>
Deletes a webhook message.
Name | Type | Description |
---|---|---|
messageId | string | The ID of the message to delete. |
options? | Object | The query parameters to send with the request. |
options.thread_id | string | - |
Promise
<void
>
A promise that resolves once the message is deleted.
src/structures/WebhookClient.ts:115
▸ edit(data
): Promise
<APIWebhook
>
Edits the webhook with the provided data.
Name | Type | Description |
---|---|---|
data | RESTPatchAPIWebhookJSONBody & { reason : string } | The data to edit the webhook with, including the reason. |
Promise
<APIWebhook
>
A promise that resolves to the edited webhook.
src/structures/WebhookClient.ts:58
▸ editMessage(messageId
, data
): Promise
<APIMessage
>
Edits a previously sent webhook message.
Name | Type | Description |
---|---|---|
messageId | string | The ID of the message to edit. |
data | RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files? : RawFile [] } | The new data for the message. |
Promise
<APIMessage
>
A promise that resolves to the edited message.
src/structures/WebhookClient.ts:98
▸ fetchMessage(messageId
, query?
): Promise
<APIMessage
>
Fetches a message that was created by the webhook.
Name | Type | Description |
---|---|---|
messageId | string | The ID of the message to fetch. |
query? | RESTGetAPIWebhookWithTokenMessageQuery | The query parameters to send with the request. |
Promise
<APIMessage
>
A promise that resolves to the fetched message.
src/structures/WebhookClient.ts:129
▸ send(data
): Promise
<APIMessage
>
Sends the provided data using the API’s execute
method.
Name | Type | Description |
---|---|---|
data | RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & { files? : RawFile [] ; wait : true } | The data to be sent. |
Promise
<APIMessage
>
A promise that resolves to the result of the execute
method.
src/structures/WebhookClient.ts:81