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:
@@ -1,4 +1,4 @@
|
||||
**Please describe the changes this PR makes and why it should be merged**:
|
||||
**Please describe the changes this PR makes and why it should be merged:**
|
||||
|
||||
|
||||
**Semantic versioning classification:**
|
||||
|
||||
@@ -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')}
|
||||
`);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "115.1.3",
|
||||
"version": "115.1.4",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -110,7 +110,7 @@ module.exports = class PhoneCall {
|
||||
|
||||
sendVoicemail(channel, msg) {
|
||||
return channel.send(stripIndents`
|
||||
☎️ New Voicemail from **${msg.guild.name}**:
|
||||
☎️ New Voicemail from **${msg.guild.name}:**
|
||||
**${msg.author.tag}:** ${msg.content}
|
||||
`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user