Aller au contenu
Version: v1.3
Sur cette page

fetch()

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

This function is used to fetch a user from the database.

Parameter Type Required Description
userId string ✅ The ID of the user.
guildId string ✅ The guild ID of the user.
  • Promise<object>

Example:

{
level: 1,
xp: 1000,
reqxp: 10000,
rank: 1,
shortxp: 1k,
shortreq: 10k
}
  • new Error() - if invalid parameters are provided.
const {fetch} = require('simply-xp');
const userId = "326815959358898189";
const guildId = "867999056172052551";
fetch(userId, guildId)
.then(console.log) // Returns the user object
.catch((err) => console.log(err)); // Returns the error