forked from engineering/cloudservices
fix interval
parent
3639178952
commit
5c869bd803
|
@ -6,7 +6,7 @@ export default function checkStaffStatus(client: Client) {
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
const accounts = await client.db.Account.find();
|
const accounts = await client.db.Account.find();
|
||||||
for (const acc of accounts) {
|
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')) {
|
if (!acc.permissions.facultyMarshal && user.roles.includes('662163685439045632')) {
|
||||||
await client.db.Account.updateOne({ username: acc.username }, { $set: { 'permissions.facultyMarshal': true } });
|
await client.db.Account.updateOne({ username: acc.username }, { $set: { 'permissions.facultyMarshal': true } });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue