import { CommandInteraction, Member } from 'eris';
import { apply as ApplyCommand } from '../commands';
import { Client, InteractionCommand, InteractionCommandOptionsType, InteractionCommandOptionsChoice } from '../class';

export default class Apply extends InteractionCommand {
  constructor(client: Client) {
    super(client);
    this.name = 'apply';
    this.description = 'Submit applications through EDS and receive decisions immediately.';
    this.permissions = 0;

    const applyc = <ApplyCommand>this.client.commands.get('apply');
    const choices: InteractionCommandOptionsChoice[] = [];
    for (const service of applyc.services) {
      choices.push({ name: service[0], value: service[0] });
    }

    this.options.push({ name: 'code',
      description: 'The application code for the application you wish to apply for.',
      type: InteractionCommandOptionsType.STRING,
      choices,
    });
  }

  public async run(interaction: CommandInteraction) {
    console.log(interaction.data);
    interaction.createMessage('HELP ME PLEASE');
  }
}
