From 77f9ca0903217d08bf22fe635feca4de8d525ab7 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Tue, 16 Jun 2020 17:32:15 -0400 Subject: [PATCH] lean whois db queries --- src/commands/whois.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/whois.ts b/src/commands/whois.ts index 1aba0e5..4717875 100644 --- a/src/commands/whois.ts +++ b/src/commands/whois.ts @@ -47,7 +47,7 @@ export default class Whois extends Command { if (ackResolve?.emailAddress) { description += `${emotes.email} ${ackResolve.emailAddress}\n`; } - const pager = await this.client.db.PagerNumber.findOne({ individualAssignID: member.user.id }); + const pager = await this.client.db.PagerNumber.findOne({ individualAssignID: member.user.id }).lean().exec(); if (pager?.num) { description += `📡 ${pager.num}\n`; } @@ -90,7 +90,7 @@ export default class Whois extends Command { if (bit & 1073741824) permissions.push('Manage Emojis'); if (bit & 4) permissions.push('Ban Members'); if (bit & 2) permissions.push('Kick Members'); - const account = await this.client.db.Member.findOne({ userID: member.id }); + const account = await this.client.db.Member.findOne({ userID: member.id }).lean().exec(); if (account?.additional?.langs.length > 0) { const langs: string[] = []; for (const lang of account.additional.langs.sort((a, b) => a.localeCompare(b))) {