{"size": 889, "ext": "js", "max_stars_repo_path": "src/structures/command/Command.js", "max_stars_repo_name": "Monkeyz-Team/ZeCarioca", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/structures/command/Command.js", "max_issues_repo_name": "Monkeyz-Team/ZeCarioca", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/structures/command/Command.js", "max_forks_repo_name": "Monkeyz-Team/ZeCarioca", "max_forks_repo_forks_event_min_datetime": "2021-01-26T22:16:06.000Z", "max_forks_repo_forks_event_max_datetime": "2021-01-26T22:16:06.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 21.6829268293, "max_line_length": 81, "alphanum_fraction": 0.6287964004}
const CommandUtils = require('./CommandUtils')
const ParrotEmbed = require('../../utils/ParrotEmbed')

module.exports = class Command {
  constructor (options = {}, client) {
    this.client = client

    this.name = options.name

    this.aliases = options.aliases || []
    this.category = options.category || 'Úteis'

    this.description = options.description || ''
    this.usage = options.usage || ''

    this.utils = options.utils
  }

  async _run (context, args) {
    try {
      await this.build(context, args)

      await this.run(context, args)
    } catch (e) {
      this.error(context, e)
    }
  }

  run () {}

  error ({ channel }, error) {
    const embed = new ParrotEmbed().setDescription(error.message).setColor('RED')

    return channel.send(embed)
  }

  build (context, args) {
    return this.utils ? CommandUtils.util(context, this.utils, args) : true
  }
}
