Add total pages to command leaderboard

This commit is contained in:
Dragon Fire
2020-05-31 22:25:16 -04:00
parent e6e2afe98f
commit 25473003c0
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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:**
+4 -4
View File
@@ -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
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "115.1.3",
"version": "115.1.4",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {
+1 -1
View File
@@ -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}
`);
}