mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add total pages to command leaderboard
This commit is contained in:
@@ -23,11 +23,11 @@ module.exports = class CommandLeaderboardCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, { page }) {
|
||||
const lb = this.makeLeaderboard(page);
|
||||
if (!lb.length) return msg.say(`Page ${page} does not exist (yet).`);
|
||||
const totalPages = Math.ceil(this.client.registry.commands.size / 10);
|
||||
if (page > totalPages) return msg.say(`Page ${page} does not exist (yet).`);
|
||||
return msg.say(stripIndents`
|
||||
__**Command Usage Leaderboard (Page ${page}):**__
|
||||
${lb.join('\n')}
|
||||
__**Command Usage Leaderboard (Page ${page}/${totalPages}):**__
|
||||
${this.makeLeaderboard(page).join('\n')}
|
||||
`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user