forked from engineering/cloudservices
add new interval which automatically updates permissions based on roles
parent
56a2b3eabf
commit
2f015b4e49
|
@ -25,6 +25,13 @@ export default function checkStaffStatus(client: Client) {
|
||||||
if (acc.permissions.staff && !user.roles.includes('446104438969466890')) {
|
if (acc.permissions.staff && !user.roles.includes('446104438969466890')) {
|
||||||
await client.db.Account.updateOne({ username: acc.username }, { $set: { 'permissions.staff': false } });
|
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);
|
}, 300000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue