import { SlashCommandBuilder } from "discord.js";
import type { CommandModule } from "../../discord/types.js";
import { musicPlayer } from "../../services/music/music-player.js";

export const skipCommand: CommandModule = {
  data: new SlashCommandBuilder().setName("skip").setDescription("현재 트랙을 스킵합니다"),
  async execute(interaction) {
    if (!interaction.guildId) return;
    try {
      const message = await musicPlayer.skip(interaction.guildId);
      await interaction.reply(message);
    } catch (error) {
      await interaction.reply({
        content: `스킵 실패: ${error instanceof Error ? error.message : "알 수 없는 오류"}`,
        ephemeral: true,
      });
    }
  },
};
