Various methods for interacting with webhooks.

Hierarchy

  • 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>

  • 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>

  • Delete a webhook via its token.

    Parameters

    • webhookID: string

      The ID of the webhook.

    • token: string

      The token of the webhook.

    Returns Promise<void>

  • 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>

  • Type Parameters

    Parameters

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

    Returns Promise<Message<T>>

  • Execute a slack 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 Slack's Documentation for more information.

    Returns Promise<void>

  • 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>

  • Get the webhooks in the specified channel.

    Parameters

    • channelID: string

      The ID of the channel to get the webhooks of.

    Returns Promise<Webhook[]>

  • Get the webhooks in the specified guild.

    Parameters

    • guildID: string

      The ID of the guild to get the webhooks of.

    Returns Promise<Webhook[]>

  • 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>>