aboutsummaryrefslogtreecommitdiff
path: root/src/commands/leveling/leaderboard.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/leveling/leaderboard.ts')
-rw-r--r--src/commands/leveling/leaderboard.ts21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts
index 040ed4a..d81d88b 100644
--- a/src/commands/leveling/leaderboard.ts
+++ b/src/commands/leveling/leaderboard.ts
@@ -1,4 +1,15 @@
-import { BushCommand, ButtonPaginator, Level, type CommandMessage, type OptArgType, type SlashMessage } from '#lib';
+import {
+ BushCommand,
+ ButtonPaginator,
+ chunk,
+ clientSendAndPermCheck,
+ emojis,
+ Level,
+ prefix,
+ type CommandMessage,
+ type OptArgType,
+ type SlashMessage
+} from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js';
@@ -23,7 +34,7 @@ export default class LeaderboardCommand extends BushCommand {
],
slash: true,
channel: 'guild',
- clientPermissions: (m) => util.clientSendAndPermCheck(m),
+ clientPermissions: (m) => clientSendAndPermCheck(m),
userPermissions: []
});
}
@@ -33,9 +44,9 @@ export default class LeaderboardCommand extends BushCommand {
if (!(await message.guild.hasFeature('leveling')))
return await message.util.reply(
- `${util.emojis.error} This command can only be run in servers with the leveling feature enabled.${
+ `${emojis.error} This command can only be run in servers with the leveling feature enabled.${
message.member?.permissions.has(PermissionFlagsBits.ManageGuild)
- ? ` You can toggle features using the \`${util.prefix(message)}features\` command.`
+ ? ` You can toggle features using the \`${prefix(message)}features\` command.`
: ''
}`
);
@@ -44,7 +55,7 @@ export default class LeaderboardCommand extends BushCommand {
const mappedRanks = ranks.map(
(val, index) => `\`${index + 1}\` <@${val.user}> - Level ${val.level} (${val.xp.toLocaleString()} xp)`
);
- const chunked = util.chunk(mappedRanks, 25);
+ const chunked = chunk(mappedRanks, 25);
const embeds = chunked.map((c) =>
new EmbedBuilder().setTitle(`${message.guild.name}'s Leaderboard`).setDescription(c.join('\n'))
);