19 lines
629 B
JavaScript
19 lines
629 B
JavaScript
const { quotesLeaderboard } = require("../../commands/slash/applications/quotes");
|
|
|
|
module.exports = {
|
|
name: 'quotes_leaderboard_right',
|
|
description: 'Navigate right 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 next page
|
|
|
|
await quotesLeaderboard(interaction, page);
|
|
}
|
|
}; |