mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 18:29:14 +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:**
|
**Semantic versioning classification:**
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ module.exports = class CommandLeaderboardCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run(msg, { page }) {
|
run(msg, { page }) {
|
||||||
const lb = this.makeLeaderboard(page);
|
const totalPages = Math.ceil(this.client.registry.commands.size / 10);
|
||||||
if (!lb.length) return msg.say(`Page ${page} does not exist (yet).`);
|
if (page > totalPages) return msg.say(`Page ${page} does not exist (yet).`);
|
||||||
return msg.say(stripIndents`
|
return msg.say(stripIndents`
|
||||||
__**Command Usage Leaderboard (Page ${page}):**__
|
__**Command Usage Leaderboard (Page ${page}/${totalPages}):**__
|
||||||
${lb.join('\n')}
|
${this.makeLeaderboard(page).join('\n')}
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "115.1.3",
|
"version": "115.1.4",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ module.exports = class PhoneCall {
|
|||||||
|
|
||||||
sendVoicemail(channel, msg) {
|
sendVoicemail(channel, msg) {
|
||||||
return channel.send(stripIndents`
|
return channel.send(stripIndents`
|
||||||
☎️ New Voicemail from **${msg.guild.name}**:
|
☎️ New Voicemail from **${msg.guild.name}:**
|
||||||
**${msg.author.tag}:** ${msg.content}
|
**${msg.author.tag}:** ${msg.content}
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user