add new interval which automatically updates permissions based on roles

merge-requests/4/head
Matthew 2020-03-28 12:14:39 -04:00
parent 56a2b3eabf
commit 2f015b4e49
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,13 @@ export default function checkStaffStatus(client: Client) {
if (acc.permissions.staff && !user.roles.includes('446104438969466890')) {
await client.db.Account.updateOne({ username: acc.username }, { $set: { 'permissions.staff': false } });
}
if (acc.permissions.staff && acc.tier > 3) {
await client.db.Account.updateOne({ username: acc.username }, { $set: { tier: 3 } });
client.getDMChannel(acc.userID).then((chan) => {
chan.createMessage('***Your account has automatically been upgraded to Tier 3 since you are a Staff member.***');
});
}
}
}, 300000);
}