Class ChannelUnreadCollection

Collection of Channel Unreads

Hierarchy (View Summary)

Constructors

Properties

client: Client
getUnderlyingObject: (id: string) => HydratedChannelUnread
updateUnderlyingObject: SetStoreFunction<Record<string, HydratedChannelUnread>>

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

      Instance

    • context: unknown

      Context

    • Optionaldata: unknown

      Data

    Returns void

  • Get or create

    Parameters

    • id: string

      Id

    • data: {
          _id: { channel: string; user: string };
          last_id?: null | string;
          mentions?: string[];
      }

      Data

      • _id: { channel: string; user: string }

        Composite key pointing to a user's view of a channel

        • channel: string

          Channel Id

        • user: string

          User Id

      • Optionallast_id?: null | string

        Id of the last message read in this channel by a user

      • Optionalmentions?: string[]

        Array of message ids that mention the user

    Returns ChannelUnread