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