Skip to content
On this page

removeLevel()

This function is used to remove levels from a user.

When the user’s level actually changes, this function also triggers XpEvents callbacks (levelUp / levelDown) and awaits them before resolving.

Parameter Type Required Description
userId string ✅ The ID of the user.
guildId string ✅ The guild ID.
level number ✅ The amount of levels to remove.
username string ❌ The name of user.
  • XpFatal - if invalid parameters are provided.
const { removeLevel } = require("simply-xp");
const userid = "770551872309166090";
const guildid = "867999056172052551";
const level = 69;
const username = "Rahuletto";
removeLevel(userid, guildid, level, username)
.then(console.log) // Returns the user object
.catch((err) => console.log(err)); // Returns the error