Webhook
Defined in: packages/structures/src/resources.ts:436
A Discord webhook — an HTTP endpoint that can post messages to a channel.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Webhook(
data):Webhook
Defined in: packages/structures/src/resources.ts:453
Creates a webhook from Discord data.
Parameters
Section titled “Parameters”application_id?
Section titled “application_id?”string | null
avatar?
Section titled “avatar?”string | null
channel_id?
Section titled “channel_id?”string | null
guild_id?
Section titled “guild_id?”string | null
string
string | null
token?
Section titled “token?”string
number
Returns
Section titled “Returns”Webhook
Overrides
Section titled “Overrides”Properties
Section titled “Properties”applicationId
Section titled “applicationId”
readonlyapplicationId:string|null
Defined in: packages/structures/src/resources.ts:448
Application that created this webhook, if any.
avatarHash
Section titled “avatarHash”avatarHash:
string|null
Defined in: packages/structures/src/resources.ts:442
Webhook avatar hash.
channelId
Section titled “channelId”
readonlychannelId:string|null
Defined in: packages/structures/src/resources.ts:444
Channel this webhook posts to.
guildId
Section titled “guildId”
readonlyguildId:string|null
Defined in: packages/structures/src/resources.ts:446
Guild this webhook belongs to.
readonlyid:string
Defined in: packages/structures/src/base.ts:12
Inherited from
Section titled “Inherited from”name:
string|null
Defined in: packages/structures/src/resources.ts:440
Webhook display name.
readonlytoken:string|null
Defined in: packages/structures/src/resources.ts:450
Webhook token (only present for incoming webhooks).
readonlytype:number
Defined in: packages/structures/src/resources.ts:438
Webhook type.
Accessors
Section titled “Accessors”createdAt
Section titled “createdAt”Get Signature
Section titled “Get Signature”get createdAt():
Date
Defined in: packages/structures/src/base.ts:29
Returns the timestamp this snowflake was created at.
Returns
Section titled “Returns”Date
Inherited from
Section titled “Inherited from”createdTimestamp
Section titled “createdTimestamp”Get Signature
Section titled “Get Signature”get createdTimestamp():
number
Defined in: packages/structures/src/base.ts:25
Milliseconds since the Unix epoch at which this snowflake was created.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”BaseStructure.createdTimestamp
Get Signature
Section titled “Get Signature”get url():
string|null
Defined in: packages/structures/src/resources.ts:480
Returns the webhook execution URL, or null if no token is set.
Returns
Section titled “Returns”string | null
Methods
Section titled “Methods”avatarURL()
Section titled “avatarURL()”avatarURL(
options?):string|null
Defined in: packages/structures/src/resources.ts:474
Returns the webhook avatar URL, or null if no avatar is set.
Parameters
Section titled “Parameters”options?
Section titled “options?”ImageURLOptions = {}
Returns
Section titled “Returns”string | null
toString()
Section titled “toString()”toString():
string
Defined in: packages/structures/src/resources.ts:487
Returns the webhook URL or its ID as a string.
Returns
Section titled “Returns”string