class WebhooksAPI

export declare class WebhooksAPI

Constructors

constructor(
rest: REST
)

Constructs a new instance of the WebhooksAPI class

create(
channelId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<never>

Creates a new webhook

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

deleteMessage(
token: string
messageId: Snowflake
query?: { thread_id?: string; }
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
body: RESTPatchAPIWebhookWithTokenMessageJSONBody & { thread_id?: string; }
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

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