Class ChannelCollection

Collection of Channels

Hierarchy

Constructors

Properties

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

Type declaration

    • (id): HydratedChannel
    • Parameters

      • id: string

      Returns HydratedChannel

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedChannel>>

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: Channel

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

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

    Parameters

    • cb: ((value, key, map) => void)

      Callback for each pair

        • (value, key, map): void
        • Parameters

          Returns void

    Returns void

    Iterable

  • Get or create

    Parameters

    • id: string

      Id

    • data: {
          _id: string;
          channel_type: "SavedMessages";
          user: string;
      } | {
          _id: string;
          active: boolean;
          channel_type: "DirectMessage";
          last_message_id?: null | string;
          recipients: string[];
      } | {
          _id: string;
          channel_type: "Group";
          description?: null | string;
          icon?: 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;
          };
          last_message_id?: null | string;
          name: string;
          nsfw?: boolean;
          owner: string;
          permissions?: null | number;
          recipients: string[];
      } | {
          _id: string;
          channel_type: "TextChannel";
          default_permissions?: null | {
              a: number;
              d: number;
          };
          description?: null | string;
          icon?: 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;
          };
          last_message_id?: null | string;
          name: string;
          nsfw?: boolean;
          role_permissions?: {
              [key: string]: components["schemas"]["OverrideField"];
          };
          server: string;
      } | {
          _id: string;
          channel_type: "VoiceChannel";
          default_permissions?: null | {
              a: number;
              d: number;
          };
          description?: null | string;
          icon?: 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;
          };
          name: string;
          nsfw?: boolean;
          role_permissions?: {
              [key: string]: components["schemas"]["OverrideField"];
          };
          server: string;
      }

      Data

    • isNew: boolean = false

      Whether this object is new

    Returns Channel

Generated using TypeDoc