The manager of webhooks that belong to a channel.

Example

new ChannelWebhookManager(channel);

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

cache: CacheCollection<string, Webhook>

This cache of the manager.

channel: Channel
client: Client

Methods

  • Create a webhook in the channel.

    Returns

    The created webhook.

    Example

    webhooks.create('My Webhook');
    

    Parameters

    • name: string

      The name of the webhook.

    Returns Promise<Webhook>

  • Delete a webhook in the channel.

    Example

    webhooks.delete(webhook);
    

    Parameters

    • webhook: string | Webhook

      The webhook to delete.

    Returns Promise<void>

  • Edit a webhook in the channel.

    Returns

    The edited webhook.

    Example

    webhooks.edit(webhook, 'My Webhook');
    

    Parameters

    • webhook: string | Webhook

      The webhook to edit.

    • name: string

      The name of the webhook.

    • Optional channelId: string

      The ID of the channel to move the webhook to.

    Returns Promise<Webhook>

  • Fetch a webhook from the channel, or cache.

    Returns

    The fetched webhook.

    Example

    webhooks.fetch(webhook);
    

    Parameters

    • webhook: string | Webhook

      The webhoook to fetch.

    • Optional options: FetchOptions

      The options to fetch the webhook with.

    Returns Promise<Webhook>

  • Fetch multiple webhooks from the channel.

    Returns

    The fetched webhooks.

    Example

    webhooks.fetch();
    

    Parameters

    Returns Promise<Collection<string, Webhook>>

  • Set the maximum cache size of the manager.

    Returns

    The manager.

    Example

    manager.setMaxCache(100);
    

    Parameters

    • maxSize: number

      The maximum size of the cache.

    Returns ChannelWebhookManager