Skip to content

Webhook

Defined in: packages/structures/src/resources.ts:436

A Discord webhook — an HTTP endpoint that can post messages to a channel.

new Webhook(data): Webhook

Defined in: packages/structures/src/resources.ts:453

Creates a webhook from Discord data.

string | null

string | null

string | null

string | null

string

string | null

string

number

Webhook

BaseStructure.constructor

readonly applicationId: string | null

Defined in: packages/structures/src/resources.ts:448

Application that created this webhook, if any.


avatarHash: string | null

Defined in: packages/structures/src/resources.ts:442

Webhook avatar hash.


readonly channelId: string | null

Defined in: packages/structures/src/resources.ts:444

Channel this webhook posts to.


readonly guildId: string | null

Defined in: packages/structures/src/resources.ts:446

Guild this webhook belongs to.


readonly id: string

Defined in: packages/structures/src/base.ts:12

BaseStructure.id


name: string | null

Defined in: packages/structures/src/resources.ts:440

Webhook display name.


readonly token: string | null

Defined in: packages/structures/src/resources.ts:450

Webhook token (only present for incoming webhooks).


readonly type: number

Defined in: packages/structures/src/resources.ts:438

Webhook type.

get createdAt(): Date

Defined in: packages/structures/src/base.ts:29

Returns the timestamp this snowflake was created at.

Date

BaseStructure.createdAt


get createdTimestamp(): number

Defined in: packages/structures/src/base.ts:25

Milliseconds since the Unix epoch at which this snowflake was created.

number

BaseStructure.createdTimestamp


get url(): string | null

Defined in: packages/structures/src/resources.ts:480

Returns the webhook execution URL, or null if no token is set.

string | null

avatarURL(options?): string | null

Defined in: packages/structures/src/resources.ts:474

Returns the webhook avatar URL, or null if no avatar is set.

ImageURLOptions = {}

string | null


toString(): string

Defined in: packages/structures/src/resources.ts:487

Returns the webhook URL or its ID as a string.

string

BaseStructure.toString