aboutsummaryrefslogtreecommitdiff
path: root/src/commands/leveling/setXp.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/leveling/setXp.ts')
-rw-r--r--src/commands/leveling/setXp.ts6
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,