Webhook

export class Webhook extends WebhookMixin()
export class Webhook extends WebhookMixin()
Represents a webhook.

Extends

WebhookMixin()
applicationId:Snowflake | null
The application that created this webhook
avatar:string | null
The avatar for the webhook
The channel the webhook belongs to
channelId:Snowflake
The id of the channel the webhook belongs to
Readonly
client:Client
The client that instantiated the webhook
guildId:Snowflake
The guild the webhook belongs to
name:string
The name of the webhook
owner:User | APIUser | null
The owner of the webhook
sourceChannel:NewsChannel | APIPartialChannel | null
The source channel of the webhook
sourceGuild:Guild | APIPartialGuild | null
The source guild of the webhook
token:string | null
The token for the webhook, unavailable for follower webhooks and webhooks owned by another application.
The type of the webhook
avatarURL(options?):string | null
A link to the webhook's avatar.
Returns
NameTypeOptionalDescription
optionsImageURLOptionsYesOptions for the image URL
editMessage(message, options):Promise<Message>
Edits a message that was sent by this webhook.
Returns
Returns the message edited by this webhook
NameTypeOptionalDescription
messageMessageResolvableNoThe message to edit
optionsstring | MessagePayload | WebhookMessageEditOptionsNoThe options to provide
fetchMessage(message, options?):Promise<Message>
Gets a message that was sent by this webhook.
Returns
Returns the message sent by this webhook
NameTypeOptionalDescription
messageSnowflakeNoThe id of the message to fetch
optionsWebhookFetchMessageOptionsYesThe options to provide to fetch the message.
isApplicationCreated():this is this & { type: WebhookType.Application; applicationId: Snowflake; owner: User | APIUser; }
Whether this webhook is created by an application.
isChannelFollower():this is this & { type: WebhookType.ChannelFollower; sourceGuild: Guild | APIPartialGuild; sourceChannel: NewsChannel | APIPartialChannel; token: null; applicationId: null; owner: User | APIUser; }
Whether or not this webhook is a channel follower webhook.
isIncoming():this is this & { type: WebhookType.Incoming; token: string; }
Whether or not this webhook is an incoming webhook.
isUserCreated():this is this & { type: WebhookType.Incoming; applicationId: null; owner: User | APIUser; }
Whether this webhook is created by a user.
send(options):Promise<Message>
Sends a message with this webhook.
NameTypeOptionalDescription
optionsstring | MessagePayload | WebhookMessageCreateOptionsNoThe options to provide