From cfe996b52d9a5b72fd3c87e6e499125460ae04b4 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 18 Apr 2020 12:29:41 -0400 Subject: [PATCH] Add UserFlags support to user command --- commands/info/user.js | 17 +++++++++++++++++ package.json | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/commands/info/user.js b/commands/info/user.js index 34a9edc3..4ce1b802 100644 --- a/commands/info/user.js +++ b/commands/info/user.js @@ -3,6 +3,21 @@ const moment = require('moment'); const { MessageEmbed } = require('discord.js'); const { stripIndents } = require('common-tags'); const { trimArray } = require('../../util/Util'); +const flags = { + DISCORD_EMPLOYEE: 'Discord Employee', + DISCORD_PARTNER: 'Discord Partner', + BUGHUNTER_LEVEL_1: 'Bug Hunter (Level 1)', + BUGHUNTER_LEVEL_2: 'Bug Hunter (Level 2)', + HYPESQUAD_EVENTS: 'HypeSquad Events', + HOUSE_BRAVERY: 'House of Bravery', + HOUSE_BRILLIANCE: 'House of Brilliance', + HOUSE_BALANCE: 'House of Balance', + EARLY_SUPPORTER: 'Early Supporter', + TEAM_USER: 'Team User', + SYSTEM: 'System', + VERIFIED_BOT: 'Verified Bot', + VERIFIED_DEVELOPER: 'Verified Bot Developer' +}; module.exports = class UserCommand extends Command { constructor(client) { @@ -28,11 +43,13 @@ module.exports = class UserCommand extends Command { const embed = new MessageEmbed() .setAuthor(user.tag) .setThumbnail(user.displayAvatarURL({ format: 'png', dynamic: true })); + const userFlags = user.flags.toArray(); let description = stripIndents` **General User Info:** • ID: ${user.id} • Discord Join Date: ${moment.utc(user.createdAt).format('MM/DD/YYYY h:mm A')} • ${user.bot ? 'Bot' : 'Not a Bot'} + • Flags: ${userFlags.length ? userFlags.map(flag => flags[flag]).join(', ') : 'None'} `; if (msg.guild) { try { diff --git a/package.json b/package.json index 404c49e4..9c21fff3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "113.0.5", + "version": "113.0.6", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {