text: const { MessageEmbed } = require("discord.js");
  const moment = require("moment");
  
  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 = {
    name: "user-info",
    description: "Shows a users info",
    usage: "user-info [@mention]",
    aliases: ["ui"],
    cooldown: 0,
    run: async (client, message, args) => {
      const member = message.mentions.members.last() || message.member;
      const roles = member.roles.cache
        .sort((a, b) => b.position - a.position)
        .map((role) => role.toString())
        .slice(0, -1);
      const userFlags = member.user.flags.toArray();
      if (!member.user.activities) member.user.activities = { name: "none" };
      const embed = new MessageEmbed()
        
        .setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 512 }))
        .setColor("RANDOM")
        .addField("User", [
          `**❯ Username:** ${member.user.username}`,
          `**❯ Discriminator:** ${member.user.discriminator}`,
          `**❯ ID:** ${member.id}`,
          `**❯ Badges:** ${
            userFlags.length
              ? userFlags.map((flag) => flags[flag]).join(", ")
              : "None"
          }`,
          `**❯ Avatar:** [Link to avatar](${member.user.displayAvatarURL({
            dynamic: true,
          })})`,
          `**❯ Time Created:** ${moment(member.user.createdTimestamp).format(
            "LT"
          )} ${moment(member.user.createdTimestamp).format("LL")} ${moment(
            member.user.createdTimestamp
          ).fromNow()}`,
          `**❯ Activity:** *${
            member.user.presence.activities[0] || "`No Activity`"
          }*`,
          `**❯ Nickname:** ${member.nickname || "None"}`,
          `\u200b`,
        ])
        .addField("Member", [
          `**❯ Highest Role:** ${
            member.roles.highest.id === message.guild.id
              ? "None"
              : member.roles.highest.name
          }`,
          `**❯ Server Join Date:** ${moment(member.joinedAt).format("LL LTS")}`,
          `**❯ Hoist Role:** ${
            member.roles.hoist ? member.roles.hoist.name : "None"
          }`,
          `**❯ Roles [${roles.length}]:** ${
            roles.length ? roles.join(", ") : "None"
          }`,
          `\u200b`,
        ])
        .setFooter(
          `Requested by ${message.author.username}`,
          `${message.author.displayAvatarURL({ dynamic: true })}`
        );
      return message.channel.send({embeds: [embed]});
    },
  };
  