import { SlashCommandBuilder, ChatInputCommandInteraction } from 'discord.js';
import { SlashCommand } from '../../utils/types';
import { context } from '../../config/context';

const command: SlashCommand = {
  guildOnly: true,
  data: new SlashCommandBuilder()
    .setName('play')
    .setDescription('Spielt einen Song oder fügt ihn zur Queue hinzu.')
    .addStringOption((opt) => opt.setName('query').setDescription('Link oder Suchbegriff').setRequired(true)),
  async execute(interaction: ChatInputCommandInteraction) {
    const query = interaction.options.getString('query', true);
    await context.music.play(interaction, query);
  }
};

export default command;

