Class SessionCollection

Collection of Sessions

Hierarchy

Constructors

Properties

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

Type declaration

    • (id: string): HydratedSession
    • Parameters

      • id: string

      Returns HydratedSession

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedSession>>

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

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Delete all sessions, optionally including self

    Parameters

    • revokeSelf: boolean = false

      Whether to remove current session too

    Returns Promise<void>

  • Get or create

    Returns

    Session

    Parameters

    • id: string

      Id

    • data: {
          _id: string;
          name: string;
      }

      Data

      • _id: string
      • name: string

    Returns Session

Generated using TypeDoc