diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-08 16:02:51 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-08 16:02:51 -0400 |
commit | b6d1ac9a60e8b8a967ef3e93b92b9748d1f637f9 (patch) | |
tree | da1b870adc36a1a114d4c61d7695e034fd5abd79 /src/commands/leveling/setXp.ts | |
parent | f366181069e1fd4daf7cf379d10c44c25fad84c2 (diff) | |
download | tanzanite-b6d1ac9a60e8b8a967ef3e93b92b9748d1f637f9.tar.gz tanzanite-b6d1ac9a60e8b8a967ef3e93b92b9748d1f637f9.tar.bz2 tanzanite-b6d1ac9a60e8b8a967ef3e93b92b9748d1f637f9.zip |
fix support threads, allow 0 for abreviated numbers, fix accent colors
Diffstat (limited to 'src/commands/leveling/setXp.ts')
-rw-r--r-- | src/commands/leveling/setXp.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/commands/leveling/setXp.ts b/src/commands/leveling/setXp.ts index fdfd74f..8be3a10 100644 --- a/src/commands/leveling/setXp.ts +++ b/src/commands/leveling/setXp.ts @@ -62,6 +62,12 @@ export default class SetXpCommand extends BushCommand { return await message.util.reply(`${util.emojis.error} This command is Bestower proof.`); if (!user.id) throw new Error('user.id is null'); + if (isNaN(xp)) return await message.util.reply(`${util.emojis.error} Provide a valid number.`); + if (xp > 2147483647 || xp < 0) + return await message.util.reply( + `${util.emojis.error} Provide an positive integer under \`2147483647\` to set the user's xp to.` + ); + const [levelEntry] = await Level.findOrBuild({ where: { user: user.id, |