fix interval

merge-requests/4/head
Matthew 2020-03-29 18:12:36 -04:00
parent 3639178952
commit 5c869bd803
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ export default function checkStaffStatus(client: Client) {
setInterval(async () => {
const accounts = await client.db.Account.find();
for (const acc of accounts) {
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) || await client.guilds.get('446067825673633794').getRESTMember(acc.userID);
if (!acc.permissions.facultyMarshal && user.roles.includes('662163685439045632')) {
await client.db.Account.updateOne({ username: acc.username }, { $set: { 'permissions.facultyMarshal': true } });
}