class WebhooksAPI

export declare class WebhooksAPI

Constructors

constructor(
rest: REST
)

Constructs a new instance of the WebhooksAPI class

deleteMessage(
token: string
messageId: Snowflake
query?: { thread_id?: Snowflake; }
options?: Pick<RequestData, 'signal'>
) : Promise<void>

Deletes an associated message from a webhook

See also: https://discord.com/developers/docs/resources/webhook#delete-webhook-message

editMessage(
token: string
messageId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIMessage>

Edits an associated message from a webhook

See also: https://discord.com/developers/docs/resources/webhook#edit-webhook-message

execute(
token: string
body: CreateWebhookMessageOptions & { wait: true; }
options?: Pick<RequestData, 'signal'>
) : Promise<RESTPostAPIWebhookWithTokenWaitResult>

Executes a webhook and returns the created message

See also: https://discord.com/developers/docs/resources/webhook#execute-webhook

getMessage(
token: string
messageId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIMessage>

Fetches an associated message from a webhook

See also: https://discord.com/developers/docs/resources/webhook#get-webhook-message