evogram-gramjs 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -160,11 +160,10 @@ class SessionManager extends events_1.EventEmitter {
|
|
|
160
160
|
getAllLoadedSessions() {
|
|
161
161
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
162
162
|
const sessions = Array.from(this.sessions.values());
|
|
163
|
-
const results = yield Promise.all(sessions
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
return session;
|
|
163
|
+
const results = yield Promise.all(sessions
|
|
164
|
+
.filter((x) => x.sessionId)
|
|
165
|
+
.map((session) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
return Object.assign(Object.assign({}, session), { db: yield session.db().catch(() => null), user: yield session.user().catch(() => null) });
|
|
168
167
|
})));
|
|
169
168
|
//@ts-ignore
|
|
170
169
|
return results;
|
package/package.json
CHANGED
|
@@ -164,12 +164,17 @@ export class SessionManager extends EventEmitter {
|
|
|
164
164
|
|
|
165
165
|
async getAllLoadedSessions(): Promise<({ db: SessionEntity | null; user: Api.User | null } & Omit<SessionInfo, 'db' | 'user'>)[]> {
|
|
166
166
|
const sessions = Array.from(this.sessions.values())
|
|
167
|
+
|
|
167
168
|
const results = await Promise.all(
|
|
168
|
-
sessions
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
169
|
+
sessions
|
|
170
|
+
.filter((x) => x.sessionId)
|
|
171
|
+
.map(async (session) => {
|
|
172
|
+
return {
|
|
173
|
+
...session,
|
|
174
|
+
db: await session.db().catch(() => null),
|
|
175
|
+
user: await session.user().catch(() => null),
|
|
176
|
+
}
|
|
177
|
+
})
|
|
173
178
|
)
|
|
174
179
|
|
|
175
180
|
//@ts-ignore
|