Class ChannelWebhookCollection

Collection of Channel Webhooks

Hierarchy

  • ClassCollection<ChannelWebhook, HydratedChannelWebhook>
    • ChannelWebhookCollection

Constructors

Properties

#objects: ReactiveMap<string, ChannelWebhook> = ...
#storage: ObjectStorage<HydratedChannelWebhook> = ...
client: Client
getUnderlyingObject: ((id: string) => HydratedChannelWebhook)

Type declaration

    • (id: string): HydratedChannelWebhook
    • Parameters

      • id: string

      Returns HydratedChannelWebhook

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedChannelWebhook>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "user" | "server" | "channel" | "bot" | "channelUnread" | "channelWebhook" | "emoji" | "message" | "serverMember" | "session"

      Type

    • instance: ChannelWebhook

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Filter the collection by a given predicate

    Parameters

    • predicate: ((value: ChannelWebhook, key: string) => boolean)

      Predicate to satisfy

        • (value: ChannelWebhook, key: string): boolean
        • Parameters

          • value: ChannelWebhook
          • key: string

          Returns boolean

    Returns ChannelWebhook[]

  • Find some value based on a predicate

    Parameters

    • predicate: ((value: ChannelWebhook, key: string) => boolean)

      Predicate to satisfy

        • (value: ChannelWebhook, key: string): boolean
        • Parameters

          • value: ChannelWebhook
          • key: string

          Returns boolean

    Returns undefined | ChannelWebhook

  • Execute a provided function over each key, value pair in the map

    Returns

    Iterable

    Parameters

    • cb: ((value: ChannelWebhook, key: string, map: ReactiveMap<string, ChannelWebhook>) => void)

      Callback for each pair

        • (value: ChannelWebhook, key: string, map: ReactiveMap<string, ChannelWebhook>): void
        • Parameters

          • value: ChannelWebhook
          • key: string
          • map: ReactiveMap<string, ChannelWebhook>

          Returns void

    Returns void

  • Create webhook with ID and token

    Returns

    Webhook

    Parameters

    • id: string

      Id

    • token: string

      Token

    Returns Promise<ChannelWebhook>

  • Get or create

    Parameters

    • id: string

      Id

    • data: {
          avatar?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          channel_id: string;
          id: string;
          name: string;
          permissions: number;
          token?: null | string;
      }

      Data

      • Optional avatar?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        }

        Description

        The avatar of the webhook

      • channel_id: string

        Description

        The channel this webhook belongs to

      • id: string

        Description

        Webhook Id

      • name: string

        Description

        The name of the webhook

      • permissions: number

        Format: uint64

        Description

        The permissions for the webhook

      • Optional token?: null | string

        Description

        The private token for the webhook

    Returns ChannelWebhook

  • Map the collection using a given callback

    Type Parameters

    • O

    Parameters

    • cb: ((value: ChannelWebhook, key: string) => O)

      Callback

        • (value: ChannelWebhook, key: string): O
        • Parameters

          • value: ChannelWebhook
          • key: string

          Returns O

    Returns O[]

Generated using TypeDoc