import { Message } from 'eris';
import { Client, Command } from '../class';

import Judgement_Add from './judgement_add';
import Judgement_Delete from './judgement_delete';

export default class Judgement extends Command {
  constructor(client: Client) {
    super(client);
    this.name = 'judgement';
    this.description = 'Creates or deletes a judgement.';
    this.usage = `${this.client.config.prefix}judgement`;
    this.permissions = 5;
    this.guildOnly = true;
    this.enabled = true;
    this.subcmds = [Judgement_Add, Judgement_Delete];
  }

  public async run(message: Message, args: string[]) {
    try {
      if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
    } catch (err) {
      return this.client.util.handleError(err, message, this);
    }
  }
}
