text: const ArgumentCommand = require('../classes/argument-command');
  const { getMember } = require('../util/utils');
  const { readConfig, readMember } = require('../modules/data-manager');
  const logger = require('../modules/logger');
  const { PROFILES_PATH } = require('../constants');
  const ReadableError = require('../classes/errors/readable-error');
  
  class ProfileCommand extends ArgumentCommand {
      meta = {
          commandName: 'profile',
          description: "Shows a member's full profile",
          aliases: [],
          allowedRoles: [readConfig().adminRoleId, readConfig().moderatorRoleId]
      };
  
      args = {
          memberId: null
      };
  
      async _run() {
          if (!this.args.memberId) {
              throw new ReadableError('No member id/mention provided');
          }
  
          logger.log(`Getting profile for [${this.args.memberId}]`);
  
          const member = await getMember(this.dMsg.guild, this.args.memberId);
  
          const memberProfile = readMember(member.id, member.user.tag);
          const profileString = JSON.stringify(memberProfile, null, 2);
  
          if (profileString.length < 1990) {
              await this.dMsg.channel.send(`\`\`\`json\n${profileString}\n\`\`\``);
          } else {
              await this.dMsg.channel.send({ files: [`${PROFILES_PATH}/${member.id}.json`] });
          }
      }
  }
  
  module.exports = ProfileCommand;
  