Represents a webhook on Guilded.

Example

new Webhook(channel, rawWebhook);

Hierarchy

Constructors

  • Parameters

    • channel: Channel

      The channel the webhook belongs to.

    • raw: APIWebhook

      The raw data of the webhook.

    • Optional cache: boolean

      Whether to cache the webhook.

    Returns Webhook

Properties

channel: Channel
channelId: string

The ID of the channel the webhook belongs to.

client: Client
createdAt: Date

The date the webhook was created.

createdBy: string

The ID of the user that created the webhook.

deletedAt?: Date

The date the webhook was deleted.

id: string
name: string

The name of the webhook.

serverId: string

The ID of the server the webhook belongs to.

token?: string

The token of the webhook.

Accessors

  • get author(): undefined | ServerMember
  • The server member that created the webhook.

    Returns undefined | ServerMember

  • get authorId(): string
  • The ID of the user that created the webhook.

    Returns string

  • get createdTimestamp(): number
  • The timestamp the webhook was created.

    Returns number

  • get deletedTimestamp(): undefined | number
  • The timestamp the webhook was deleted.

    Returns undefined | number

  • get isCached(): boolean
  • Whether the webhook is cached.

    Returns boolean

  • get server(): undefined | Server
  • The server the webhook belongs to.

    Returns undefined | Server

Methods

  • Delete the webhook.

    Returns

    The deleted webhook.

    Example

    webhook.delete();
    

    Returns Promise<Webhook>

  • Edit the webhook.

    Returns

    The edited webhook.

    Example

    webhook.edit('New name');
    

    Parameters

    • name: string

      The name of the webhook.

    • Optional channelId: string

      The ID of the channel the webhook belongs to.

    Returns Promise<Webhook>

  • Fetch the webhook.

    Returns

    The fetched webhook.

    Example

    webhook.fetch();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the webhook with.

    Returns Promise<Webhook>

  • Fetch the server member that created the webhook.

    Returns

    The fetched server member.

    Example

    webhook.fetchAuthor();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the server member with.

    Returns Promise<ServerMember>

  • Fetch the server the webhook belongs to.

    Returns

    The fetched server.

    Example

    webhook.fetchServer();
    

    Parameters

    • Optional options: FetchOptions

      The options to fetch the server with.

    Returns Promise<Server>