badge thumbnails and different emotes for whois

merge-requests/1/merge
Matthew 2020-04-14 21:19:00 -04:00
parent cbc06a508d
commit d922b15475
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 15 additions and 6 deletions

View File

@ -3,6 +3,7 @@ import moment from 'moment';
import { Message, Member } from 'eris'; import { Message, Member } from 'eris';
import { Client, Command, RichEmbed } from '../class'; import { Client, Command, RichEmbed } from '../class';
import acknowledgements from '../configs/acknowledgements.json'; import acknowledgements from '../configs/acknowledgements.json';
import { whois as emotes } from '../configs/emotes.json';
export default class Whois extends Command { export default class Whois extends Command {
constructor(client: Client) { constructor(client: Client) {
@ -26,23 +27,31 @@ export default class Whois extends Command {
} }
const embed = new RichEmbed(); const embed = new RichEmbed();
embed.setAuthor(`${member.user.username}#${member.user.discriminator}`, member.user.avatarURL); embed.setAuthor(`${member.user.username}#${member.user.discriminator}`, member.user.avatarURL);
embed.setThumbnail(member.avatarURL); if (member.roles.includes('453689940140883988')) {
embed.setThumbnail('https://static.libraryofcode.org/library_of_code_associate-badge.png');
} else if (member.roles.includes('455972169449734144')) {
embed.setThumbnail('https://static.libraryofcode.org/library_of_code_sheriff-badge.png');
} else if (member.roles.includes('662163685439045632')) {
embed.setThumbnail('https://static.libraryofcode.org/library_of_code_marshal-badge.png');
} else {
embed.setThumbnail(member.avatarURL);
}
const ackResolve = this.resolveStaffInformation(member.id); const ackResolve = this.resolveStaffInformation(member.id);
let description = ''; let description = '';
if (ackResolve?.title && ackResolve?.dept) { if (ackResolve?.title && ackResolve?.dept) {
description += `<:loc:607695848612167700> __**${ackResolve.title}**__, ${ackResolve.dept}\n\n`; description += `${emotes.titleAndDepartment} __**${ackResolve.title}**__, ${ackResolve.dept}\n\n`;
} }
if (ackResolve?.emailAddress) { if (ackResolve?.emailAddress) {
description += `<:email:699730553858949273> ${ackResolve.emailAddress}\n`; description += `${emotes.email} ${ackResolve.emailAddress}\n`;
} }
if (ackResolve?.gitlab) { if (ackResolve?.gitlab) {
description += `<:gitlab:699729689220218932> ${ackResolve.gitlab}\n`; description += `${emotes.gitlab} ${ackResolve.gitlab}\n`;
} }
if (ackResolve?.github) { if (ackResolve?.github) {
description += `<:github:699729719826055179> ${ackResolve.github}\n`; description += `${emotes.github} ${ackResolve.github}\n`;
} }
if (ackResolve?.bio) { if (ackResolve?.bio) {
description += `<:bio:699731093179596854> *${ackResolve.bio}*\n`; description += `${emotes.bio} *${ackResolve.bio}*\n`;
} }
description += `\n<@${member.id}>`; description += `\n<@${member.id}>`;
embed.setDescription(description); embed.setDescription(description);