const { Events, ActivityType } = require('discord.js');
const logger = require('../utils/logger');
const { setupPlayer } = require('../structures/ShoukakuEvents'); // Import the Shoukaku player

module.exports = {
    name: Events.ClientReady,
    once: true, // This event should only run once
    async execute(client) {
        logger.info(`Ready! Logged in as ${client.user.tag}`);

        // Initialize the Shoukaku music player
        try {
            // Set up the music player with the client
            client.player = setupPlayer(client);
            logger.info('Shoukaku music player initialized successfully');
        } catch (error) {
            logger.error(`Failed to initialize Shoukaku music player: ${error.message}`);
        }

        // Set activity status
        client.user.setActivity('Music | /play', { type: ActivityType.Listening });
    },
};
