Class REST/Webhooks

Various methods for interacting with webhooks. Located at Client#rest.webhooks.

Hierarchy

  • REST/Webhooks

Constructors

Methods

  • Delete a webhook.

    Parameters

    • webhookID: string

      The ID of the webhook.

    • Optional reason: string

      The reason for deleting the webhook.

    Returns Promise<void>

    Caching

    This method does not cache its result.

  • Delete a webhook message.

    Parameters

    • webhookID: string

      The ID of the webhook.

    • token: string

      The token of the webhook.

    • messageID: string

      The ID of the message.

    • Optional options: DeleteWebhookMessageOptions

      The options for deleting the message.

    Returns Promise<void>

    Caching

    This method does not cache its result.

  • Delete a webhook via its token.

    Parameters

    • webhookID: string

      The ID of the webhook.

    • token: string

      The token of the webhook.

    Returns Promise<void>

    Caching

    This method does not cache its result.

  • Execute a GitHub compatible webhook.

    Parameters

    • webhookID: string

      The ID of the webhook.

    • token: string

      The token of the webhook.

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

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

    Returns Promise<void>

    Caching

    This method does not cache its result.

  • Type Parameters

    Parameters

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

    Returns Promise<Message<T>>

  • Get a webhook by ID (and optionally token).

    Parameters

    • webhookID: string

      The ID of the webhook.

    • Optional token: string

      The token of the webhook.

    Returns Promise<Webhook>

    Caching

    This method does not cache its result.

  • Get the webhooks in the specified channel.

    Parameters

    • channelID: string

      The ID of the channel to get the webhooks of.

    Returns Promise<Webhook[]>

    Caching

    This method does not cache its result.

  • Get a webhook message.

    Type Parameters

    Parameters

    • webhookID: string

      The ID of the webhook.

    • token: string

      The token of the webhook.

    • messageID: string

      The ID of the message.

    • Optional threadID: string

      The ID of the thread the message is in.

    Returns Promise<Message<T>>

    Caching

    This method does not cache its result.