Skip to main content

reset()

This function is used to reset the XP and level of a user.

Parameters​

ParameterTypeRequiredDefaultDescription
userIdstringβœ…The ID of the user.
guildIdstringβœ…The guild ID.
eraseboolean❌falseErase user entry from database?
usernamestring❌Username to use if auto_create is enabled.

Returns​

  • Promise<boolean>

Throws​

  • XpFatal - If invalid parameters are provided, or if there is a database error.

[JS] Example​

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

const userid = "326815959358898189";
const guildid = "867999056172052551";
const username = "Abadima";
const erase = false;

reset(userid, guildid, erase, username)
.then(console.log) // Returns true if reset was successful
.catch((err) => console.log(err)); // Returns the error