From f91cc0221a4ed2b63ec0929ddf3340ec2c0e73c1 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Thu, 1 Sep 2022 20:29:38 -0400 Subject: [PATCH] update calculation t3 staff benefit --- src/class/Util.ts | 2 +- src/commands/cwg_create.ts | 2 +- src/commands/cwg_selfserv.ts | 1 + src/intervals/checkStaffStatus.ts | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index 5309f3a..55091e2 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -125,7 +125,7 @@ export default class Util { } } - public async handleError(error: Error, message?: Message, command?: Command): Promise { + public async handleError(error: Error | any, message?: Message, command?: Command): Promise { try { this.client.signale.error(error); const info = { content: `\`\`\`js\n${error.stack}\n\`\`\``, embed: null }; diff --git a/src/commands/cwg_create.ts b/src/commands/cwg_create.ts index 99953fe..b7886ec 100644 --- a/src/commands/cwg_create.ts +++ b/src/commands/cwg_create.ts @@ -13,7 +13,7 @@ export default class CWG_Create extends Command { super(client); this.name = 'create'; this.description = 'Bind a domain to the CWG'; - this.usage = `${this.client.config.prefix}cwg create [User ID | Username] [Domain] [Port] || Use snippets raw URL`; + this.usage = `${this.client.config.prefix}cwg create [Cert Chain] [Private Key] || Use snippets raw URL`; this.permissions = { roles: ['662163685439045632', '701454780828221450'] }; this.aliases = ['bind']; this.enabled = true; diff --git a/src/commands/cwg_selfserv.ts b/src/commands/cwg_selfserv.ts index 91ea39b..a4ae8c2 100644 --- a/src/commands/cwg_selfserv.ts +++ b/src/commands/cwg_selfserv.ts @@ -113,6 +113,7 @@ export default class CWG_SelfService extends Command { } public domainTextValidation(domain: string) { + if (domain.length >= 25) return false; return /[A-Za-z0-9](?:[A-Za-z0-9-]{0,19}[A-Za-z0-9])?/.test(domain); } diff --git a/src/intervals/checkStaffStatus.ts b/src/intervals/checkStaffStatus.ts index b0affc3..7e8e9d2 100644 --- a/src/intervals/checkStaffStatus.ts +++ b/src/intervals/checkStaffStatus.ts @@ -52,7 +52,7 @@ export default function checkStaffStatus(client: Client) { await client.db.Account.updateOne({ username: acc.username }, { $set: { 'permissions.intern': false } }); } - if ((acc.permissions.staff || acc.permissions.intern || acc.permissions.technician || acc.permissions.director) && acc.tier < 3) { + if ((acc.permissions.staff || acc.permissions.intern || acc.permissions.technician || acc.permissions.director || user.roles.cache.has('858049948401401866')) && acc.tier < 3) { await client.db.Account.updateOne({ username: acc.username }, { $set: { tier: 3 } }); const embed = new MessageEmbed(); embed.setTitle('Cloud Account | Tier Change'); @@ -60,6 +60,7 @@ export default function checkStaffStatus(client: Client) { embed.addField('User', `${acc.username} | <@${acc.userID}>`, true); embed.addField('Technician', 'SYSTEM', true); embed.addField('Old Tier -> New Tier', `${acc.tier} -> 3`, true); + embed.addField('Reason', 'T3 Staff Benefit', true); embed.setFooter(client.user.username, client.user.avatarURL()); embed.setTimestamp(); const ch = await client.channels.fetch('580950455581147146') as TextChannel;