forked from engineering/cloudservices
notifs
parent
682d067f67
commit
3639178952
|
@ -1,5 +1,6 @@
|
||||||
/* eslint-disable no-await-in-loop */
|
/* eslint-disable no-await-in-loop */
|
||||||
import { Client } from '..';
|
import { Client } from '..';
|
||||||
|
import { RichEmbed } from '../class';
|
||||||
|
|
||||||
export default function checkStaffStatus(client: Client) {
|
export default function checkStaffStatus(client: Client) {
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
|
@ -28,6 +29,15 @@ export default function checkStaffStatus(client: Client) {
|
||||||
|
|
||||||
if (acc.permissions.staff && acc.tier < 3) {
|
if (acc.permissions.staff && acc.tier < 3) {
|
||||||
await client.db.Account.updateOne({ username: acc.username }, { $set: { tier: 3 } });
|
await client.db.Account.updateOne({ username: acc.username }, { $set: { tier: 3 } });
|
||||||
|
const embed = new RichEmbed();
|
||||||
|
embed.setTitle('Cloud Account | Tier Change');
|
||||||
|
embed.setColor('#0099ff');
|
||||||
|
embed.addField('User', `${acc.username} | <@${acc.userID}>`, true);
|
||||||
|
embed.addField('Moderator', `<@${client.user.id}>`, true);
|
||||||
|
embed.addField('Old Tier -> New Tier', `${acc.tier} -> 3`, true);
|
||||||
|
embed.setFooter(this.client.user.username, this.client.user.avatarURL);
|
||||||
|
embed.setTimestamp();
|
||||||
|
this.client.createMessage('580950455581147146', { embed });
|
||||||
client.getDMChannel(acc.userID).then((chan) => {
|
client.getDMChannel(acc.userID).then((chan) => {
|
||||||
chan.createMessage('***Your account has automatically been upgraded to Tier 3 since you are a Staff member.***');
|
chan.createMessage('***Your account has automatically been upgraded to Tier 3 since you are a Staff member.***');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue