WebhookShorter
Signature
export declare class WebhookShorter extends BaseShorterProperties
0No properties.
Methods
10Methods
create(channelId: string, body: RESTPostAPIChannelWebhookJSONBody): Promise<WebhookStructure>;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.
edit(webhookId: string, body: RESTPatchAPIWebhookWithTokenJSONBody | RESTPatchAPIWebhookJSONBody, options: WebhookShorterOptionalParams): Promise<WebhookStructure>;Edits a webhook.
Parameters
webhookId- The ID of the webhook.
body- The data to update the webhook with.
options- The optional parameters including token and reason.
Returns
A Promise that resolves when the webhook is edited.
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.
writeMessage(webhookId: string, token: string, payload: MessageWebhookMethodWriteWaitParams): Promise<WebhookMessageStructure>;writeMessage(webhookId: string, token: string, payload: MessageWebhookMethodWriteParams): Promise<WebhookMessageStructure | null>;Writes a message using the webhook.
Parameters
webhookId- The ID of the webhook.
token- The token of the webhook.
data- The data for writing the message.
Returns
A Promise that resolves to the written message.
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
listFromGuild(guildId: string): Promise<WebhookStructure[]>;listFromChannel(channelId: string): Promise<WebhookStructure[]>;