From a47ef150fd38fff3666faccd6f976f660fdbf9f3 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 31 Aug 2021 18:45:23 -0400 Subject: cleanup and deprecated old config commands --- src/commands/leveling/leaderboard.ts | 4 ++++ src/commands/leveling/level.ts | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'src/commands/leveling') diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts index d29c15e..953a6c5 100644 --- a/src/commands/leveling/leaderboard.ts +++ b/src/commands/leveling/leaderboard.ts @@ -39,6 +39,10 @@ export default class LeaderboardCommand extends BushCommand { public override async exec(message: BushMessage | BushSlashMessage, args: { page: number }): Promise { if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); + if (!(await message.guild.hasFeature('leveling'))) + return await message.util.reply( + `${util.emojis.error} This command can only be run in commands with the leveling feature enabled.` + ); const ranks = (await Level.findAll({ where: { guild: message.guild.id } })).sort((a, b) => b.xp - a.xp); const mapedRanks = ranks.map( (val, index) => `\`${index + 1}\` <@${val.user}> - Level ${val.level} (${val.xp.toLocaleString()} xp)` diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts index 6640744..f22ed8d 100644 --- a/src/commands/leveling/level.ts +++ b/src/commands/leveling/level.ts @@ -126,6 +126,11 @@ export default class LevelCommand extends BushCommand { } public override async exec(message: BushMessage | BushSlashMessage, args: { user?: BushUser }): Promise { + if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); + if (!(await message.guild.hasFeature('leveling'))) + return await message.util.reply( + `${util.emojis.error} This command can only be run in commands with the leveling feature enabled.` + ); const user = args.user ?? message.author; try { return await message.util.reply({ -- cgit