master
Matthew 2021-12-09 21:54:51 -05:00
parent cffe646796
commit 44aea3165f
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 3 additions and 3 deletions

View File

@ -80,8 +80,8 @@ export default class Apply extends Command {
url: 'https://eds.libraryofcode.org/cs/t3-temp', url: 'https://eds.libraryofcode.org/cs/t3-temp',
validation: async (member: Member) => { validation: async (member: Member) => {
const csAccount = await CloudServicesUtil.fetchAccountStatus(member.id, this.client.config.internalKey); const csAccount = await CloudServicesUtil.fetchAccountStatus(member.id, this.client.config.internalKey);
// const memberCheck = await this.client.db.Member.findOne({ userID: member.id }).lean().exec(); const memberCheck = await this.client.db.Member.findOne({ userID: member.id }).lean().exec();
// if (new Date() > memberCheck?.misc?.t3TemporaryExpiration?.date) return false; if (new Date() > memberCheck?.misc?.t3TemporaryExpiration?.date) return false;
if (csAccount.tier === 3) return false; if (csAccount.tier === 3) return false;
return true; return true;
}, },
@ -95,7 +95,7 @@ export default class Apply extends Command {
}); });
await addMember.save(); await addMember.save();
} }
await this.client.db.Member.updateOne({ userID: dmember.id }, { $set: { misc: { t3TemporaryExpiration: { processed: false, date: new Date(Date.now() + 129600000), previousTier: csAccount.tier } } } }); await this.client.db.Member.updateOne({ userID: dmember.id }, { $set: { misc: { t3TemporaryExpiration: { processed: false, date: new Date(Date.now() + 1800000), previousTier: csAccount.tier } } } });
await CloudServicesUtil.setTier(dmember.id, 3, this.client.config.internalKey); await CloudServicesUtil.setTier(dmember.id, 3, this.client.config.internalKey);
}, },