diff options
Diffstat (limited to 'src/commands/leveling/setXp.ts')
-rw-r--r-- | src/commands/leveling/setXp.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/commands/leveling/setXp.ts b/src/commands/leveling/setXp.ts index a86c58a..7b1b432 100644 --- a/src/commands/leveling/setXp.ts +++ b/src/commands/leveling/setXp.ts @@ -1,4 +1,5 @@ import { AllowedMentions, BushCommand, Level, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; +import assert from 'assert'; import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js'; export default class SetXpCommand extends BushCommand { @@ -39,8 +40,8 @@ export default class SetXpCommand extends BushCommand { message: BushMessage | BushSlashMessage, { user, xp }: { user: ArgType<'user'>; xp: ArgType<'abbreviatedNumber'> } ) { - if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a guild.`); - if (!user.id) throw new Error('user.id is null'); + assert(message.inGuild()); + assert(user.id); if (isNaN(xp)) return await message.util.reply(`${util.emojis.error} Provide a valid number.`); if (xp > 2147483647 || xp < 0) |