From ee2038b26b0a39ea1746c3364b7c572494863d70 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 21 Oct 2020 03:27:38 -0400 Subject: [PATCH] fix flags in whois --- src/commands/whois.ts | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/commands/whois.ts b/src/commands/whois.ts index 6943132..1b94565 100644 --- a/src/commands/whois.ts +++ b/src/commands/whois.ts @@ -35,25 +35,7 @@ export default class Whois extends Command { if (ackResolve?.pn?.length > 0) title += `, ${ackResolve.pn.join(', ')}`; embed.setAuthor(title, member.user.avatarURL); - const flags = []; - if (member.user.publicFlags) { - if (member.roles.includes('446104438969466890') || member.roles.includes('701481967149121627')) flags.push('<:loc:607695848612167700>'); - if ((member.user.publicFlags & (1 << 12)) === 1 << 12) flags.push('<:System:768370601265201152>'); - if ((member.user.publicFlags & (1 << 0)) === 1 << 0) flags.push('<:DiscordStaff:768370601882025985>'); - if ((member.user.publicFlags & (1 << 1)) === 1 << 1) flags.push('<:Partnered:768370601395879936>'); - if ((member.user.publicFlags & (1 << 3)) === 1 << 3) flags.push('<:BugHunter:768370601105555467>'); - if ((member.user.publicFlags & (1 << 14)) === 1 << 14) flags.push('<:BugHunter:768370601105555467>'); - if ((member.user.publicFlags & (1 << 2)) === 1 << 2) flags.push('<:HypeSquadEvents:768370600745762846>'); - if ((member.user.publicFlags & (1 << 6)) === 1 << 6) flags.push('<:HypeSquadBravery:768370601328640011> '); - if ((member.user.publicFlags & (1 << 7)) === 1 << 7) flags.push('<:HypeSquadBrilliance:768370600842362900>'); - if ((member.user.publicFlags & (1 << 8)) === 1 << 8) flags.push('<:HypeSquadBalance:768370599584071751> '); - if ((member.user.publicFlags & (1 << 9)) === 1 << 9) flags.push('<:EarlySupporter:768370601873768468>'); - if ((member.user.publicFlags & (1 << 16)) === 1 << 16) flags.push('<:VerifiedBot:768370599252197396>'); - if ((member.user.publicFlags & (1 << 17)) === 1 << 17) flags.push('<:VerifiedBotDeveloper:768370601701933077>'); - } - let description = ''; - if (flags.length > 0) description += `${flags.join(' ')}\n\n`; let titleAndDepartment = ''; if (ackResolve?.title && ackResolve?.dept) { titleAndDepartment += `${emotes.titleAndDepartment} __**${ackResolve.title}**__, __${ackResolve.dept}__\n\n`; @@ -99,9 +81,28 @@ export default class Whois extends Command { else totalScore = `${score.total}`; embed.addField('Community Score', totalScore, true); } else embed.addField('Community Score', 'N/C', true); + if (member.roles.length > 0) { embed.addField(`Roles [${member.roles.length}]`, member.roles.map((r) => this.mainGuild.roles.get(r)).sort((a, b) => b.position - a.position).map((r) => `<@&${r.id}>`).join(', ')); } + + const flags = []; + if (member.user.publicFlags) { + if ((member.user.publicFlags & (1 << 12)) === 1 << 12) flags.push('<:System:768370601265201152>'); + if ((member.user.publicFlags & (1 << 0)) === 1 << 0) flags.push('<:DiscordStaff:768370601882025985>'); + if ((member.user.publicFlags & (1 << 1)) === 1 << 1) flags.push('<:Partnered:768370601395879936>'); + if ((member.user.publicFlags & (1 << 3)) === 1 << 3) flags.push('<:BugHunter:768370601105555467>'); + if ((member.user.publicFlags & (1 << 14)) === 1 << 14) flags.push('<:BugHunter:768370601105555467>'); + if ((member.user.publicFlags & (1 << 2)) === 1 << 2) flags.push('<:HypeSquadEvents:768370600745762846>'); + if ((member.user.publicFlags & (1 << 6)) === 1 << 6) flags.push('<:HypeSquadBravery:768370601328640011> '); + if ((member.user.publicFlags & (1 << 7)) === 1 << 7) flags.push('<:HypeSquadBrilliance:768370600842362900>'); + if ((member.user.publicFlags & (1 << 8)) === 1 << 8) flags.push('<:HypeSquadBalance:768370599584071751> '); + if ((member.user.publicFlags & (1 << 9)) === 1 << 9) flags.push('<:EarlySupporter:768370601873768468>'); + if ((member.user.publicFlags & (1 << 16)) === 1 << 16) flags.push('<:VerifiedBot:768370599252197396>'); + if ((member.user.publicFlags & (1 << 17)) === 1 << 17) flags.push('<:VerifiedBotDeveloper:768370601701933077>'); + } + if (flags.length > 0) embed.addField('Flags', flags.join(' ')); + const permissions: string[] = []; const serverAcknowledgements: string[] = []; const bit = member.permission.allow;