Skip to main content

setLevel()

This function is used to set the level of a user.

Parameters​

ParameterTypeRequiredDescription
userIdstringβœ…The ID of the user.
guildIdstringβœ…The guild ID.
levelnumberβœ…The amount of XP to add.
usernamestring❌The name of user.

Returns​

Throws​

  • XpFatal - if invalid parameters are provided.

[JS] Example​

const {setLevel} = require('simply-xp');

const userid = "326815959358898189";
const guildid = "867999056172052551";
const level = 25;
const username = "Abadima";

setLevel(userid, guildid, level, username)
.then(console.log) // Returns the user object
.catch((err) => console.log(err)); // Returns the error