1
0
Fork 0
refactor/models
Matthew 2020-10-31 02:41:23 -04:00
parent a636cc66d4
commit bf98b85987
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 4 additions and 1 deletions

View File

@ -36,6 +36,7 @@ export default class Webhook extends Route {
const account = await this.server.client.db.Account.findOne({ userID: req.query.userID.toString() });
const tier = await this.server.client.db.Tier.findOne({ id: 2 });
if (account.tier >= 2) return res.sendStatus(200);
if (account.ramLimitNotification !== -1) {
await account.updateOne({ $set: { tier: 2, ramLimitNotification: tier.resourceLimits.ram - 20 } });
} else {
@ -50,7 +51,9 @@ export default class Webhook extends Route {
embed.setFooter(this.server.client.user.username, this.server.client.user.avatarURL);
embed.setTimestamp();
await this.server.client.util.sendMessageToUserTerminal(account.username, 'A technician has changed your tier to 2').catch(() => { });
this.server.client.createMessage('580950455581147146', { embed }); return this.server.client.getDMChannel(account.userID).then((channel) => channel.createMessage({ embed })).catch();
this.server.client.createMessage('580950455581147146', { embed });
this.server.client.getDMChannel(account.userID).then((channel) => channel.createMessage({ embed })).catch();
return res.sendStatus(200);
});
this.router.get('/score', async (req, res) => {