Skip to content

SessionManager

classe · Source

Manages API methods for users and stores their cache.

Extends: CachedManager

Properties

currentSessionIdHash

currentSessionIdHash: string

The current session ID hash of the client. Source

cache

cache: Collection<string, Session>

The cache of Sessions Source

currentSession

nullable

currentSession: Session

Get the current session of the client. You must call fetch() first to populate the cache. Source

_cache

readonly · private

_cache: Collection

The private cache of items for this manager. Source

holds

readonly · private

holds: function

The data structure belonging to this manager. Source

client

readonly

client: Client

The client that instantiated this Manager Source

Methods

fetch

fetch(): Promise<Collection<string, Session>>

Fetch all sessions of the client. Returns: Promise<Collection<string, Session>>Source

logoutAllDevices

logoutAllDevices(): Promise<void>

Logout all client (remote). Returns: Promise<void>Source

resolve

resolve(idOrInstance: string | Object): Object

Resolves a data entry to a data Object. Parameters

NameTypeDescription
idOrInstancestring | ObjectThe id or instance of something in this Manager

Returns: Object — An instance from this Manager Source

resolveId

resolveId(idOrInstance: string | Object): Snowflake

Resolves a data entry to an instance id. Parameters

NameTypeDescription
idOrInstancestring | ObjectThe id or instance of something in this Manager

Returns: SnowflakeSource

Unofficial software. Not affiliated with or supported by Discord.