WebhookShorter

Signature

export declare class WebhookShorter extends BaseShorter

Methods

delete(webhookId: string, options: WebhookShorterOptionalParams): Promise<undefined>;

Deletes a webhook.

Parameters
webhookId
The ID of the webhook.
options
The optional parameters including token and reason.
Returns

A Promise that resolves when the webhook is deleted.

fetch(webhookId: string, token?: string): Promise<WebhookStructure>;

Fetches a webhook.

Parameters
webhookId
The ID of the webhook.
token
The token of the webhook (optional).
Returns

A Promise that resolves to the fetched webhook.

editMessage(webhookId: string, token: string, { messageId, body: data, ...json }: MessageWebhookMethodEditParams): Promise<WebhookMessageStructure>;

Edits a message sent by the webhook.

Parameters
webhookId
The ID of the webhook.
token
The token of the webhook.
messageId
The ID of the message to edit.
data
The data for editing the message.
Returns

A Promise that resolves to the edited message.

deleteMessage(payload: WebhookShorterMessageDeleteParams): Promise<undefined>;

Deletes a message sent by the webhook.

Parameters
webhookId
The ID of the webhook.
token
The token of the webhook.
messageId
The ID of the message to delete.
reason
The reason for deleting the message.
Returns

A Promise that resolves when the message is deleted.

fetchMessage(payload: WebhookShorterMessageFetchParams): Promise<WebhookMessageStructure>;

Fetches a message sent by the webhook.

Parameters
webhookId
The ID of the webhook.
token
The token of the webhook.
messageId
The ID of the message to fetch.
threadId
The ID of the thread the message belongs to.
Returns

A Promise that resolves to the fetched message