From 2f015b4e49cbfece0c02c4f9bca63672568593f4 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 28 Mar 2020 12:14:39 -0400 Subject: [PATCH] add new interval which automatically updates permissions based on roles --- src/intervals/checkStaffStatus.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/intervals/checkStaffStatus.ts b/src/intervals/checkStaffStatus.ts index b34586c..bfff788 100644 --- a/src/intervals/checkStaffStatus.ts +++ b/src/intervals/checkStaffStatus.ts @@ -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); }