const { quotesLeaderboard } = require("../../commands/slash/applications/quotes");

module.exports = {
    name: 'quotes_leaderboard_left',
    description: 'Navigate left through the quotes leaderboard',
    async execute(interaction) {
        await interaction.deferReply();

        // Parse current page from footer
        let page = 1;
        const footerText = interaction.message.embeds[0]?.footer?.text || '';
        const match = footerText.match(/Page (\d+) of (\d+)/);
        if (match) page = Number(match[1]);

        page--; // move to previous page

        await quotesLeaderboard(interaction, page);
    }
};