bug fixes

merge-requests/4/head
Matthew 2020-08-13 01:30:53 -04:00
parent 35055412a9
commit d44d41a330
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 7 additions and 1 deletions

View File

@ -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) {