1
0
Fork 0

change whois command styling

refactor/models
Matthew 2020-04-08 07:02:49 -04:00
parent 9adaa33636
commit 585b86f9a2
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
2 changed files with 30 additions and 11 deletions

View File

@ -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'; 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); embed.addField('Storage', data, true);
let details = ''; let details = '';
if (account.locked) details += 'This account is currently locked.\n'; if (account.locked) details += '__This account is currently locked.__\n';
if (account.permissions.facultyMarshal) details += 'This account belongs to a Faculty Marshal.\n'; if (account.permissions.facultyMarshal) {
else if (account.permissions.sheriff) details += 'This account belongs to a Sheriff.\n'; details += 'This account belongs to a Faculty Marshal.\n';
else if (account.permissions.staff) details += 'This account belongs to a Staff member.\n'; const roleColor = this.client.guilds.get('446067825673633794').roles.get('662163685439045632').color;
if (account.root) details += 'This account has root/administrative privileges.\n'; 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); if (details) embed.addField('Additional Details', details, true);
embed.setFooter(this.client.user.username, this.client.user.avatarURL); embed.setFooter(this.client.user.username, this.client.user.avatarURL);
embed.setTimestamp(); embed.setTimestamp();

View File

@ -23,7 +23,6 @@ export default class Whois_User extends Command {
const embed = new RichEmbed(); const embed = new RichEmbed();
embed.setTitle('Account Information'); embed.setTitle('Account Information');
if (this.client.users.get(account.userID)) embed.setThumbnail(this.client.users.get(account.userID).avatarURL); 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('Username', `${account.username} | <@${account.userID}>`, true);
embed.addField('ID', account.userID, true); embed.addField('ID', account.userID, true);
embed.addField('Tier', String(account.tier), 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'; 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); embed.addField('Storage', data, true);
let details = ''; let details = '';
if (account.locked) details += 'This account is currently locked.\n'; if (account.locked) details += '__This account is currently locked.__\n';
if (account.permissions.facultyMarshal) details += 'This account belongs to a Faculty Marshal.\n'; if (account.permissions.facultyMarshal) {
else if (account.permissions.sheriff) details += 'This account belongs to a Sheriff.\n'; details += 'This account belongs to a Faculty Marshal.\n';
else if (account.permissions.staff) details += 'This account belongs to a Staff member.\n'; const roleColor = this.client.guilds.get('446067825673633794').roles.get('662163685439045632').color;
if (account.root) details += 'This account has root/administrative privileges.\n'; 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); if (details) embed.addField('Additional Details', details, true);
embed.setFooter(this.client.user.username, this.client.user.avatarURL); embed.setFooter(this.client.user.username, this.client.user.avatarURL);
embed.setTimestamp(); embed.setTimestamp();