Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebhookManager

Hierarchy

  • WebhookManager

Index

Constructors

  • Parameters

    • token: string

      Bot's token

    • tokenType: string
    • version: APIVersions

      API Version

    Returns WebhookManager

Methods

  • createWebhook(channelId: string, name: string, avatar?: any): Promise<Webhook>
  • Creates a webhook in the specified channel

    Parameters

    • channelId: string

      The channel ID of the channel you want to create the webhook in.

    • name: string

      The name of the webhook.

    • Optional avatar: any

    Returns Promise<Webhook>

    Webhook object

  • deleteWebhook(webhookId: string): Promise<void>
  • Deletes a webhook

    Parameters

    • webhookId: string

      The ID of the webhook you want to delete.

    Returns Promise<void>

  • deleteWebhookMessage(webhookId: string, webhookToken: string, messageId: string, params?: ExecuteWebhookParams): Promise<void>
  • Parameters

    Returns Promise<void>

  • deleteWebhookWithToken(webhookId: string, webhookToken: string): Promise<void>
  • Deletes a webhook with the given ID and token

    Parameters

    • webhookId: string

      The ID of the webhook you want to delete.

    • webhookToken: string

      The token of the webhook you want to delete.

    Returns Promise<void>

  • Edit a webhook message

    Parameters

    • webhookId: string

      The ID of the webhook you want to send the message to.

    • webhookToken: string

      The token of the webhook.

    • messageId: string

      The ID of the message you want to edit.

    • options: ExecuteWebhookOptions

      ExecuteWebhookOptions

    • params: ExecuteWebhookParams = {}

      ExecuteWebhookParams = {}

    Returns Promise<Message>

    Message object.

  • Executes a webhook

    Parameters

    • webhookId: string

      The ID of the webhook you want to execute.

    • webhookToken: string

      The token of the webhook.

    • options: ExecuteWebhookOptions

      ExecuteWebhookOptions

    • params: ExecuteWebhookParams = {}

      ExecuteWebhookParams = {}

    Returns Promise<Message>

    A message object.

  • getChannelWebhooks(channelId: string): Promise<Webhook[]>
  • Get all webhooks in a channel

    Parameters

    • channelId: string

      The ID of the channel you want to get the webhooks from.

    Returns Promise<Webhook[]>

    Array of webhooks

  • getGuilWebhooks(guildId: string): Promise<Webhook[]>
  • Gets all the webhooks in a guild.

    Parameters

    • guildId: string

      The ID of the guild you want to get the webhooks from.

    Returns Promise<Webhook[]>

    Array of webhooks

  • getWebhook(webhookId: string): Promise<Webhook>
  • Gets a webhook by its ID

    Parameters

    • webhookId: string

      The ID of the webhook you want to get.

    Returns Promise<Webhook>

    Webhook object.

  • Get a webhook message

    Parameters

    • webhookId: string

      The ID of the webhook.

    • webhookToken: string

      The token of the webhook.

    • messageId: string

      The ID of the message to get.

    • params: GetWebhookMessageParams = {}

      {

    Returns Promise<Message>

    A message object.

  • getWebhookWithToken(webhookId: string, webhookToken: string): Promise<Webhook>
  • Gets a webhook with a token.

    Parameters

    • webhookId: string

      The ID of the webhook you want to get.

    • webhookToken: string

      The token of the webhook.

    Returns Promise<Webhook>

    Webhook object

  • modifyWebhook(webhookId: string, options: ModifyWebhookOptions): Promise<Webhook>
  • Modify a webhook

    Parameters

    • webhookId: string

      The ID of the webhook you want to modify.

    • options: ModifyWebhookOptions

      ModifyWebhookOptions

    Returns Promise<Webhook>

    Webhook object.

  • modifyWebhookWithToken(webhookId: string, webhookToken: string, options: ModifyWebhookOptions): Promise<Webhook>
  • Modify a webhook with a token.

    Parameters

    • webhookId: string

      The ID of the webhook you want to modify.

    • webhookToken: string

      The token of the webhook.

    • options: ModifyWebhookOptions

      ModifyWebhookOptions

    Returns Promise<Webhook>

    Webhook object.

Properties

version: APIVersions

API Version

#token: string

Bot's token

#tokenType: string

Token type

Generated using TypeDoc