<commit_before>const Command = require('../Command');

class HelpCommand extends Command {
  constructor(bot) {
    super(bot);
    this.props.help = {
      name: 'help',
      description: 'you all need some help',
      usage: 'help [command]',
    };
    this.props.conf.aliases = ['support'];
  }
  run(msg, args) {
    let commandName = args[0];
    if (!commandName) {
      let commands = this.bot.commands;
      let commandsForEveryone = commands.filter(e => !e.conf.permLevel || e.conf.permLevel === 0);
      let commandsForAdmin = commands.filter(e => e.conf.permLevel === 1);
      let commandsForOwner = commands.filter(e => e.conf.permLevel === 2);

      let embed = new this.embed()
      .setColor('#84F139')
      .setTitle(`Commands List`)
      .setDescription(`Use \`${this.bot.prefix}help <command>\` for details\n\u200B`)
      .setFooter(this.bot.user.username, this.bot.user.avatarURL)
      .addField('__Public__', commandsForEveryone.map(command => {
        let help = command.help;
        return `\`${help.name}\`: ${help.summary || help.description}`;
      }).join('\n'));

      if (msg.client.permissions(msg) > 0 && commandsForAdmin.size) {
        embed.addField('__Admin__', commandsForAdmin.map(command => {
          let help = command.help;
          return `\`${help.name}\`: ${help.summary || help.description}`;
        }).join('\n'));
      }
      if (msg.client.permissions(msg) > 1 && commandsForOwner.size) {
        embed.addField('__Owner__', commandsForOwner.map(command => {
          let help = command.help;
          return `\`${help.name}\`: ${help.summary || help.description}`;
        }).join('\n'));
      }

      return msg.channel.sendEmbed(embed);
    } else if (commandName) {
      let command = this.bot.commands.get(commandName) || (this.bot.aliases.has(commandName) ? this.bot.commands.get(this.bot.aliases.get(commandName)) : null);
      if (!command) return this.commandError(msg, `Command \`${commandName}\` doesn't exist`);

      let embed = new this.embed()
      .setColor('#84F139')
      .setTitle(`Command  \`${command.help.name}\``)
      .setDescription(`${command.help.description || command.help.summary}\n\u200B`)
      .setFooter(this.bot.user.username, this.bot.user.avatarURL)
      .addField('Usage', [
        '```js',
        `${this.bot.prefix}${command.help.usage}`,
        '```',
      ].join('\n'));

      if (command.conf.aliases && command.conf.aliases.length) embed.addField('Aliases', command.conf.aliases.map(e => `\`${e}\``).join(', '), true);
      if (command.help.examples && command.help.examples.length) {
        embed.addField('Examples', command.help.examples.map(e => `\`${this.bot.prefix}${e}\``).join('\n'), true);
      }
      embed.addField('Permission', `${this._permLevelToWord(command.conf.permLevel)}\n\u200B`);

      return msg.channel.sendEmbed(embed);<commit_msg>Update Command: help - remove codeblock in command usage<commit_after>const Command = require('../Command');

class HelpCommand extends Command {
  constructor(bot) {
    super(bot);
    this.props.help = {
      name: 'help',
      description: 'you all need some help',
      usage: 'help [command]',
    };
    this.props.conf.aliases = ['support'];
  }
  run(msg, args) {
    let commandName = args[0];
    if (!commandName) {
      let commands = this.bot.commands;
      let commandsForEveryone = commands.filter(e => !e.conf.permLevel || e.conf.permLevel === 0);
      let commandsForAdmin = commands.filter(e => e.conf.permLevel === 1);
      let commandsForOwner = commands.filter(e => e.conf.permLevel === 2);

      let embed = new this.embed()
      .setColor('#84F139')
      .setTitle(`Commands List`)
      .setDescription(`Use \`${this.bot.prefix}help <command>\` for details\n\u200B`)
      .setFooter(this.bot.user.username, this.bot.user.avatarURL)
      .addField('__Public__', commandsForEveryone.map(command => {
        let help = command.help;
        return `\`${help.name}\`: ${help.summary || help.description}`;
      }).join('\n'));

      if (msg.client.permissions(msg) > 0 && commandsForAdmin.size) {
        embed.addField('__Admin__', commandsForAdmin.map(command => {
          let help = command.help;
          return `\`${help.name}\`: ${help.summary || help.description}`;
        }).join('\n'));
      }
      if (msg.client.permissions(msg) > 1 && commandsForOwner.size) {
        embed.addField('__Owner__', commandsForOwner.map(command => {
          let help = command.help;
          return `\`${help.name}\`: ${help.summary || help.description}`;
        }).join('\n'));
      }

      return msg.channel.sendEmbed(embed);
    } else if (commandName) {
      let command = this.bot.commands.get(commandName) || (this.bot.aliases.has(commandName) ? this.bot.commands.get(this.bot.aliases.get(commandName)) : null);
      if (!command) return this.commandError(msg, `Command \`${commandName}\` doesn't exist`);

      let embed = new this.embed()
      .setColor('#84F139')
      .setTitle(`Command  \`${command.help.name}\``)
      .setDescription(`${command.help.description || command.help.summary}\n\u200B`)
      .setFooter(this.bot.user.username, this.bot.user.avatarURL)
      .addField('Usage', `${this.bot.prefix}${command.help.usage}`);

      if (command.conf.aliases && command.conf.aliases.length) embed.addField('Aliases', command.conf.aliases.map(e => `\`${e}\``).join(', '), true);
      if (command.help.examples && command.help.examples.length) {
        embed.addField('Examples', command.help.examples.map(e => `\`${this.bot.prefix}${e}\``).join('\n'), true);
      }
      embed.addField('Permission', `${this._permLevelToWord(command.conf.permLevel)}\n\u200B`);

      return msg.channel.sendEmbed(embed);
{'fraction_non_alphanumeric': 0.18868252039576464, 'fraction_numerical': 0.008679048776254122, 'mean_word_length': 3.0406732117812063, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3368870', 'n_tokens_mistral': 1880, 'n_tokens_neox': 1833, 'n_words': 310}