A base class which most other classes extend.

Hierarchy

Constructors

Properties

application: null | ClientApplication | Uncached

The application associatd with this webhook.

avatar: null | string

The hash of this webhook's avatar.

channel: null | Uncached | AnyGuildTextChannel

The channel this webhook is for, if applicable.

guild: null | Guild

The guild 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, "id" | "name">

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

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

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.

Accessors

Methods

  • The url of this webhook's avatar.

    Returns

    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).

    Returns

    Parameters

    • Optional reason: string

      The reason for deleting this webhook.

    Returns Promise<void>

  • Delete this webhook via its token.

    Returns

    Parameters

    • Optional token: string

      The token for the webhook, if not already present.

    Returns Promise<void>

  • Execute this webhook as github compatible.

    Returns

    Parameters

    • options: Record<string, unknown> & { wait: false }

      The options to send. See Github's documentation for more information.

    • Optional token: string

      The token for the webhook, if not already present.

    Returns Promise<void>

  • Type Parameters

    Parameters

    • options: Record<string, unknown> & { wait?: true }
    • Optional token: string

    Returns Promise<Message<T>>

  • Execute this webhook as slack compatible.

    Returns

    Parameters

    • options: Record<string, unknown> & { wait: false }

      The options to send. See Slack's Documentation for more information.

    • Optional token: string

    Returns Promise<void>

  • Type Parameters

    Parameters

    • options: Record<string, unknown> & { wait?: true }
    • Optional token: string

    Returns Promise<Message<T>>

  • Get a webhook message.

    Returns

    Type Parameters

    Parameters

    • messageID: string

      The id of the message.

    • Optional threadID: string

      The id of the thread the message is in.

    • Optional token: string

      The token for the webhook, if not already present.

    Returns Promise<Message<T>>

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

    Returns

    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