Class Webhook

Represents a webhook.

Hierarchy

Accessors

Constructors

Methods

  • The url of this webhook's avatar.

    Parameters

    • Optional format: "jpg" | "jpeg" | "png" | "webp" | "gif"

      The format the url should be.

    • Optional size: number

      The dimensions of the image.

    Returns null | string

  • Delete this webhook (requires a bot user, see deleteToken).

    Parameters

    • Optional reason: string

      The reason for deleting this webhook.

    Returns Promise<void>

  • Delete a message from this webhook.

    Parameters

    • messageID: string

      The ID of the message.

    • Optional options: DeleteWebhookMessageOptions

      The options for deleting the message.

    • Optional token: string

      The token for the webhook, if not already present.

    Returns Promise<void>

  • Delete this webhook via its token.

    Parameters

    • Optional token: string

      The token for the webhook, if not already present.

    Returns Promise<void>

  • The url of this webhook's sourceGuild icon (only present on channel follower webhooks).

    Parameters

    • Optional format: "jpg" | "jpeg" | "png" | "webp" | "gif"

      The format the url should be.

    • Optional size: number

      The dimensions of the image.

    Returns null | string

Properties

application?: null | ClientApplication

The application associated with this webhook.

applicationID: null | string

The ID of the application associated with this webhook.

avatar: null | string

The hash of this webhook's avatar.

channelID: null | string

The ID of the channel this webhook is for, if applicable.

guildID: null | string

The id of the guild this webhook is in, if applicable.

id: string
name: null | string

The username of this webhook, if any.

sourceChannel?: Pick<RawChannel, "name" | "id">

The source channel for this webhook (channel follower only).

sourceGuild?: Pick<RawGuild, "name" | "id" | "icon">

The source guild for this webhook (channel follower only).

token?: string

The token for this webhook (not present for webhooks created by other applications)

The type of this webhook.

user: null | User

The user that created this webhook.