lean whois db queries

merge-requests/6/merge
Matthew 2020-06-16 17:32:15 -04:00
parent 6522eadf19
commit 77f9ca0903
No known key found for this signature in database
GPG Key ID: F841AB9BF496C194
1 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ export default class Whois extends Command {
if (ackResolve?.emailAddress) { if (ackResolve?.emailAddress) {
description += `${emotes.email} ${ackResolve.emailAddress}\n`; 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) { if (pager?.num) {
description += `📡 ${pager.num}\n`; description += `📡 ${pager.num}\n`;
} }
@ -90,7 +90,7 @@ export default class Whois extends Command {
if (bit & 1073741824) permissions.push('Manage Emojis'); if (bit & 1073741824) permissions.push('Manage Emojis');
if (bit & 4) permissions.push('Ban Members'); if (bit & 4) permissions.push('Ban Members');
if (bit & 2) permissions.push('Kick 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) { if (account?.additional?.langs.length > 0) {
const langs: string[] = []; const langs: string[] = [];
for (const lang of account.additional.langs.sort((a, b) => a.localeCompare(b))) { for (const lang of account.additional.langs.sort((a, b) => a.localeCompare(b))) {