aboutsummaryrefslogtreecommitdiff
path: root/src/commands/leveling/leaderboard.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-16 14:32:18 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-16 14:32:18 -0400
commit0e87bbd3940d89defcb04926587b35c8f4d1947f (patch)
treee50860d4dc25a11d4c3977b583284c4bcad1b077 /src/commands/leveling/leaderboard.ts
parent661e4c9935aeb8760dafc7ced4bbec6cc356a033 (diff)
downloadtanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.tar.gz
tanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.tar.bz2
tanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.zip
remove util classes, move config out of src
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'))
);