removeXP()
This function is used to remove XP from a user.
Parametersβ
Parameter | Type | Required | Description |
---|---|---|---|
userId | string | β | The ID of the user. |
guildId | string | β | The guild ID. |
xpData | number {min, max} | β | The amount of XP to remove. |
username | string | β | The name of user, if auto_create is on. |
Returnsβ
- Promise<
XpResult
>
Throwsβ
XpFatal
- if invalid parameters are provided.
[JS] Exampleβ
const {removeXP} = require('simply-xp');
const userid = "326815959358898189";
const guildid = "867999056172052551";
const username = "Abadima";
const xp = 10000000; // or xp = {min: 5000000, max: 10000000}
removeXP(userid, guildid, xp, username)
.then(console.log) // Returns the user object
.catch((err) => console.log(err)); // Returns the error