setXP()
This function is used to set the XP of a user.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | string | ✅ | The ID of the user. |
| guildId | string | ✅ | The guild ID. |
| xp | number | ✅ | The absolute XP value to set. |
| username | string | ❌ | The name of user. |
Returns
- Promise<
XpResult>
Throws
XpFatal- if invalid parameters are provided.
[JS] Example
const { setXP } = require("simply-xp");
const userid = "326815959358898189";
const guildid = "867999056172052551";
const username = "Abadima";
const xp = 10000000;
setXP(userid, guildid, xp, username)
.then(console.log) // Returns the user object
.catch((err) => console.log(err)); // Returns the error