Aller au contenu
Version: v1.2
Sur cette page

setXP()

Ce contenu n’est pas encore disponible dans votre langue.

This function is used to set the user’s experience in the database.

Parameter Type Required Description
userId string ✅ The User ID
guildId string ✅ The Guild ID
xp number ✅ The XP to set.
  • Promise<{ xp: number }>
  • new Error() - if the user ID, guild ID or amount is missing, or the amount is not a number.
const { setXP } = require("simply-xp");
const userId = "770551872309166090";
const guildId = "867999056172052551";
const xp = 1000;
setXP(userId, guildId, xp)
.then(console.log) // Returns the updated xp
.catch((err) => console.log(err)); // Returns the error