addLevel()
This function is used to add levels to a user.
Parametersβ
Parameter | Type | Required | Description |
---|---|---|---|
message | Message | β | The message object. |
userId | string | β | The User ID |
guildId | string | β | The Guild ID |
level | number | β | Amount of levels to add. |
Returnsβ
- Promise<
{ level: number, xp: number }
>
Throwsβ
new Error()
- if invalid parameters are provided.
[JS] Exampleβ
const {addLevel} = require("simply-xp");
const userid = "770551872309166090";
const guildid = "867999056172052551";
const level = 69;
addLevel(message, userid, guildid, level)
.then(console.log) // Returns the updated level and xp
.catch((err) => console.log(err)); // Returns the error