pull/15/head
Matthew 2021-10-11 21:05:12 -04:00
parent 5ca005cf90
commit 361fa4a5cc
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,7 @@ async function checkt2(auth: string, userID: string) {
} }
export default async function t2checkCron(client: Client) { export default async function t2checkCron(client: Client) {
const checkTier2StatusJob = new cron.CronJob('0 21 * * *', async () => { const checkTier2StatusJob = new cron.CronJob('7 21 * * *', async () => {
const users = await client.db.Account.find({ tier: 2 }).lean(); const users = await client.db.Account.find({ tier: 2 }).lean();
for (const user of users) { for (const user of users) {
@ -37,10 +37,11 @@ export default async function t2checkCron(client: Client) {
embed.setColor('#0099ff'); embed.setColor('#0099ff');
embed.addField('User', `${user.username} | <@${user.userID}>`, true); embed.addField('User', `${user.username} | <@${user.userID}>`, true);
embed.addField('Technician', 'SYSTEM', true); embed.addField('Technician', 'SYSTEM', true);
embed.addField('Old Tier -> New Tier', `${user.tier} -> ${args[1]}`, true); embed.addField('Old Tier -> New Tier', `${user.tier} -> 1`, true);
embed.setFooter(client.user.username, client.user.avatarURL()); embed.setFooter(client.user.username, client.user.avatarURL());
embed.setTimestamp(); embed.setTimestamp();
const ch = client.channels.cache.get('580950455581147146') as TextChannel; const ch = client.channels.cache.get('580950455581147146') as TextChannel;
await client.db.Account.updateOne({ userID: user.userID }, { $set: { tier: 1 } });
ch.send({ embeds: [embed] }); ch.send({ embeds: [embed] });
return client.users.fetch(user.userID).then((u) => u.send({ embeds: [embed], content: `__**Tier 2 Account Review**__\n\nHello, <@${user.userID}>.\nWe periodically run automatic account review inquiries for users with Tier 2. This means we request an account review from EDS to determine if you're still eligible to keep Tier 2.\nUnfortunately, according to EDS' records, you are currently ineligible for Tier 2. Because of this, we're going to automatically revoke your Tier 2 status. You can re-apply to Tier 2 at any time if you feel that you meet the requirements. If you have any questions, or if you believe this may be a mistake, please contact our support team as soon as possible. Thank you.` })).catch(); return client.users.fetch(user.userID).then((u) => u.send({ embeds: [embed], content: `__**Tier 2 Account Review**__\n\nHello, <@${user.userID}>.\nWe periodically run automatic account review inquiries for users with Tier 2. This means we request an account review from EDS to determine if you're still eligible to keep Tier 2.\nUnfortunately, according to EDS' records, you are currently ineligible for Tier 2. Because of this, we're going to automatically revoke your Tier 2 status. You can re-apply to Tier 2 at any time if you feel that you meet the requirements. If you have any questions, or if you believe this may be a mistake, please contact our support team as soon as possible. Thank you.` })).catch();
} }