changes to member post nominals

merge-requests/26/head
Matthew 2021-06-27 16:09:47 -04:00
parent d0214d8eef
commit 234cbb1df2
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 13 additions and 0 deletions

View File

@ -15,6 +15,15 @@ export default class Whois extends Command {
this.enabled = true;
}
public memberPostNominals(member: Member): string[] | false {
const arr = [];
if (member.roles.includes('858049948401401866')) arr.push('RCA');
if (member.roles.includes('506943223680466955')) arr.push('PRF-C');
if (arr.length <= 0) return false;
return arr;
}
public async run(message: Message, args: string[]) {
try {
let member: Member;
@ -34,7 +43,11 @@ export default class Whois extends Command {
const embed = new RichEmbed();
embed.setThumbnail(member.avatarURL);
const ackResolve = await this.client.db.Staff.findOne({ userID: member.id }).lean().exec();
const mpn = this.memberPostNominals(member);
let title = `${member.user.username}#${member.user.discriminator}`;
if (!ackResolve && mpn) {
title += `, ${mpn.join(', ')}`;
}
if (ackResolve?.pn?.length > 0) title += `, ${ackResolve.pn.join(', ')}`;
embed.setAuthor(title, member.user.avatarURL);