From d44d41a330a547733fe3e18ace1ebf8ba65c62c8 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Thu, 13 Aug 2020 01:30:53 -0400 Subject: [PATCH] bug fixes --- src/intervals/checkStaffStatus.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/intervals/checkStaffStatus.ts b/src/intervals/checkStaffStatus.ts index 1b46eab..1cb68fd 100644 --- a/src/intervals/checkStaffStatus.ts +++ b/src/intervals/checkStaffStatus.ts @@ -6,8 +6,14 @@ export default function checkStaffStatus(client: Client) { const accounts = await client.db.Account.find(); for (const acc of accounts) { const tier3 = await client.db.Tier.findOne({ id: 3 }); + try { + await client.guilds.get('446067825673633794').getRESTMember(acc.userID); + } catch { + // eslint-disable-next-line no-unused-expressions + () => {}; + } - const user = client.guilds.get('446067825673633794').members.get(acc.userID) || await client.guilds.get('446067825673633794').getRESTMember(acc.userID); + const user = client.guilds.get('446067825673633794').members.get(acc.userID); if (!acc.permissions.director && user.roles.includes('662163685439045632')) { await client.db.Account.updateOne({ username: acc.username }, { $set: { 'permissions.director': true } }); if (acc.ramLimitNotification !== -1) {