Represents a Guild or channel webhook.

Hierarchy (view full)

Constructors

  • Parameters

    • data: {
          avatar?: string;
          channelId: string;
          createdAt: string;
          createdBy: string;
          deletedAt?: string;
          id: string;
          name: string;
          serverId: string;
          token?: string;
      }

      raw data.

      • Optionalavatar?: string

        Avatar Format: media-uri

        The avatar image associated with the webhook

      • channelId: string

        Channel ID Format: uuid

        The ID of the channel

      • createdAt: string

        Created at Format: date-time

        The ISO 8601 timestamp that the webhook was created at

      • createdBy: string

        Created by

        The ID of the user who created this webhook

      • OptionaldeletedAt?: string

        Deleted at Format: date-time

        The ISO 8601 timestamp that the webhook was deleted at

      • id: string

        Webhook ID Format: uuid

        The ID of the webhook

      • name: string

        Name

        The name of the webhook

      • serverId: string

        Server ID

        The ID of the server

      • Optionaltoken?: string

        Token

        The token of the webhook

    • client: Client

      client.

    Returns Webhook

Properties

channelID: string

ID of the channel, where the webhook comes from.

client: Client

App's client.

createdAt: Date

When the webhook was created.

deletedAt: null | Date

When the webhook was deleted.

guildID: string

ID of the guild, where the webhook comes from.

id: string

Item ID

ownerID: string

ID of the webhook's owner.

token: null | string

Token of the webhook.

username: string

Username of the webhook.

Methods

  • Delete the webhook.

    Returns Promise<void>

  • Update the webhook.

    Parameters

    Returns Promise<Webhook>

  • Request Webhook Token if not provided.

    Returns Promise<string>

    This method sets this Webhook's token property as well as returning its token.