diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-19 18:52:41 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-02-19 18:52:41 -0500 |
commit | e78beed6c7e094ef48aad5d18da01b2bbed4536c (patch) | |
tree | 32676793af5f7bdc39d438ff284fa5b959274e96 /src/commands/leveling/setXp.ts | |
parent | a3103b629250de3fb97a40a4f9ff7e7ba28f4d16 (diff) | |
download | tanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.tar.gz tanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.tar.bz2 tanzanite-e78beed6c7e094ef48aad5d18da01b2bbed4536c.zip |
fix: a ton of shit
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) |