fixed server count in stats (#69)
diff --git a/src/utils/database.ts b/src/utils/database.ts
index 3121d06..ddee338 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -144,13 +144,17 @@
}
async staffChannels(): Promise<string[]> {
- const entries = await this.guilds
+ const entries = (await this.guilds
.find(
{ "logging.staff.channel": { $exists: true } },
{ projection: { "logging.staff.channel": 1, _id: 0 } }
)
- .toArray();
- return entries.map((e) => e.logging.staff.channel!);
+ .toArray()).map((e) => e.logging.staff.channel);
+ const out: string[] = [];
+ for (const entry of entries) {
+ if (entry) out.push(entry);
+ }
+ return out;
}
}