Skip to content

InteractionWebhook ​

classe · Source

Represents a webhook for an Interaction Implements: Webhook

Constructor ​

new InteractionWebhook(client: Client, id: Snowflake, token: string)

Parameters

NameTypeDescription
clientClientThe instantiating client
idSnowflakeThe application's id
tokenstringThe interaction's token

Properties ​

client ​

readonly

client: Client

The client that instantiated the interaction webhook Source

id ​

id: Snowflake

The webhook's id Source

url ​

readonly

url: string

The URL of this webhook Source

Methods ​

send ​

send(options: string | MessagePayload | InteractionReplyOptions): Promise<(Message|APIMessage)>

Sends a message with this webhook. Parameters

NameTypeDescription
optionsstring | MessagePayload | InteractionReplyOptionsThe content for the reply

Returns: Promise<(Message\|APIMessage)>Source

fetchMessage ​

async

async fetchMessage(message: Snowflake | '@original', cacheOrOptions?: WebhookFetchMessageOptions | boolean): Promise<(Message|APIMessage)>

Gets a message that was sent by this webhook. Parameters

NameTypeDescription
messageSnowflake | '@original'The id of the message to fetch
cacheOrOptions?WebhookFetchMessageOptions | booleanThe options to provide to fetch the message.
A deprecated boolean may be passed instead to specify whether to cache the message. Default: {}.

Returns: Promise<(Message\|APIMessage)> — Returns the raw message data if the webhook was instantiated as a WebhookClient or if the channel is uncached, otherwise a Message will be returned Source

editMessage ​

async

async editMessage(message: MessageResolvable | '@original', options: string | MessagePayload | WebhookEditMessageOptions): Promise<(Message|APIMessage)>

Edits a message that was sent by this webhook. Parameters

NameTypeDescription
messageMessageResolvable | '@original'The message to edit
optionsstring | MessagePayload | WebhookEditMessageOptionsThe options to provide

Returns: Promise<(Message\|APIMessage)> — Returns the raw message data if the webhook was instantiated as a WebhookClient or if the channel is uncached, otherwise a Message will be returned Source

deleteMessage ​

async

async deleteMessage(message: MessageResolvable | '@original', threadId?: Snowflake): Promise<void>

Delete a message that was sent by this webhook. Parameters

NameTypeDescription
messageMessageResolvable | '@original'The message to delete
threadId?SnowflakeThe id of the thread this message belongs to

Returns: Promise<void>Source

Unofficial software. Not affiliated with or supported by Discord.