From 585b86f9a2cf2ecd8a6d4f1b58f8e9c0e9906be3 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 8 Apr 2020 07:02:49 -0400 Subject: [PATCH] change whois command styling --- src/commands/whois.ts | 20 +++++++++++++++----- src/commands/whois_user.ts | 21 +++++++++++++++------ 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/commands/whois.ts b/src/commands/whois.ts index fd05802..945a67a 100644 --- a/src/commands/whois.ts +++ b/src/commands/whois.ts @@ -44,11 +44,21 @@ export default class Whois extends Command { const data = await this.client.redis.get(`storage-${account.username}`) ? dataConversion(Number(await this.client.redis.get(`storage-${account.username}`))) : 'N/A'; embed.addField('Storage', data, true); let details = ''; - if (account.locked) details += 'This account is currently locked.\n'; - if (account.permissions.facultyMarshal) details += 'This account belongs to a Faculty Marshal.\n'; - else if (account.permissions.sheriff) details += 'This account belongs to a Sheriff.\n'; - else if (account.permissions.staff) details += 'This account belongs to a Staff member.\n'; - if (account.root) details += 'This account has root/administrative privileges.\n'; + if (account.locked) details += '__This account is currently locked.__\n'; + if (account.permissions.facultyMarshal) { + details += 'This account belongs to a Faculty Marshal.\n'; + const roleColor = this.client.guilds.get('446067825673633794').roles.get('662163685439045632').color; + embed.setColor(roleColor); + } else if (account.permissions.sheriff) { + details += 'This account belongs to a Sheriff.\n'; + const roleColor = this.client.guilds.get('446067825673633794').roles.get('455972169449734144').color; + embed.setColor(roleColor); + } else if (account.permissions.staff) { + details += 'This account belongs to a Staff member.\n'; + const roleColor = this.client.guilds.get('446067825673633794').roles.get('453689940140883988').color; + embed.setColor(roleColor); + } else embed.setColor(0x36393f); + if (account.root) details += '**This account has root/administrative privileges.**\n'; if (details) embed.addField('Additional Details', details, true); embed.setFooter(this.client.user.username, this.client.user.avatarURL); embed.setTimestamp(); diff --git a/src/commands/whois_user.ts b/src/commands/whois_user.ts index 9254e07..b9d99d4 100644 --- a/src/commands/whois_user.ts +++ b/src/commands/whois_user.ts @@ -23,7 +23,6 @@ export default class Whois_User extends Command { const embed = new RichEmbed(); embed.setTitle('Account Information'); if (this.client.users.get(account.userID)) embed.setThumbnail(this.client.users.get(account.userID).avatarURL); - embed.setColor(0x36393f); embed.addField('Username', `${account.username} | <@${account.userID}>`, true); embed.addField('ID', account.userID, true); embed.addField('Tier', String(account.tier), true); @@ -35,11 +34,21 @@ export default class Whois_User extends Command { const data = await this.client.redis.get(`storage-${account.username}`) ? dataConversion(Number(await this.client.redis.get(`storage-${account.username}`))) : 'N/A'; embed.addField('Storage', data, true); let details = ''; - if (account.locked) details += 'This account is currently locked.\n'; - if (account.permissions.facultyMarshal) details += 'This account belongs to a Faculty Marshal.\n'; - else if (account.permissions.sheriff) details += 'This account belongs to a Sheriff.\n'; - else if (account.permissions.staff) details += 'This account belongs to a Staff member.\n'; - if (account.root) details += 'This account has root/administrative privileges.\n'; + if (account.locked) details += '__This account is currently locked.__\n'; + if (account.permissions.facultyMarshal) { + details += 'This account belongs to a Faculty Marshal.\n'; + const roleColor = this.client.guilds.get('446067825673633794').roles.get('662163685439045632').color; + embed.setColor(roleColor); + } else if (account.permissions.sheriff) { + details += 'This account belongs to a Sheriff.\n'; + const roleColor = this.client.guilds.get('446067825673633794').roles.get('455972169449734144').color; + embed.setColor(roleColor); + } else if (account.permissions.staff) { + details += 'This account belongs to a Staff member.\n'; + const roleColor = this.client.guilds.get('446067825673633794').roles.get('453689940140883988').color; + embed.setColor(roleColor); + } else embed.setColor(0x36393f); + if (account.root) details += '**This account has root/administrative privileges.**\n'; if (details) embed.addField('Additional Details', details, true); embed.setFooter(this.client.user.username, this.client.user.avatarURL); embed.setTimestamp();