import { applyCommandDescription, applyOptionDescription } from '@nexumi/shared';
import { ChannelType, SlashCommandBuilder } from 'discord.js';

export const statsCommandData = applyCommandDescription(
  new SlashCommandBuilder()
    .setName('stats')
    .addSubcommand((sub) =>
      applyCommandDescription(sub.setName('setup'), 'stats.setup.description')
        .addChannelOption((option) =>
          applyOptionDescription(
            option
              .setName('members_channel')
              .setRequired(true)
              .addChannelTypes(ChannelType.GuildVoice, ChannelType.GuildText),
            'stats.setup.options.members_channel'
          )
        )
        .addChannelOption((option) =>
          applyOptionDescription(
            option
              .setName('online_channel')
              .setRequired(true)
              .addChannelTypes(ChannelType.GuildVoice, ChannelType.GuildText),
            'stats.setup.options.online_channel'
          )
        )
        .addChannelOption((option) =>
          applyOptionDescription(
            option
              .setName('boosts_channel')
              .setRequired(true)
              .addChannelTypes(ChannelType.GuildVoice, ChannelType.GuildText),
            'stats.setup.options.boosts_channel'
          )
        )
        .addStringOption((option) =>
          applyOptionDescription(option.setName('members_template'), 'stats.setup.options.members_template')
        )
        .addStringOption((option) =>
          applyOptionDescription(option.setName('online_template'), 'stats.setup.options.online_template')
        )
        .addStringOption((option) =>
          applyOptionDescription(option.setName('boosts_template'), 'stats.setup.options.boosts_template')
        )
    )
    .addSubcommand((sub) => applyCommandDescription(sub.setName('refresh'), 'stats.refresh.description')),
  'stats.description'
);

export const invitesCommandData = applyCommandDescription(
  new SlashCommandBuilder()
    .setName('invites')
    .addSubcommand((sub) =>
      applyCommandDescription(sub.setName('view'), 'invites.view.description').addUserOption((option) =>
        applyOptionDescription(option.setName('user'), 'invites.view.options.user')
      )
    )
    .addSubcommand((sub) => applyCommandDescription(sub.setName('leaderboard'), 'invites.leaderboard.description')),
  'invites.description'
);
