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
currentSession: Session
Get the current session of the client. You must call fetch() first to populate the cache. Source
_cache
_cache: Collection
The private cache of items for this manager. Source
holds
holds: function
The data structure belonging to this manager. Source
client
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
| Name | Type | Description |
|---|---|---|
idOrInstance | string | Object | The 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
| Name | Type | Description |
|---|---|---|
idOrInstance | string | Object | The id or instance of something in this Manager |
Returns: SnowflakeSource