createVersion: v1.4
Sur cette page
create()
Ce contenu n’est pas encore disponible dans votre langue.
This function is used to create a user in the database.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | string | ✅ | The User ID |
| guildId | string | ✅ | The Guild ID |
Returns
Section titled “Returns”- Promise<
true | undefined> -trueif the user was created,undefinedif the user already existed.
Throws
Section titled “Throws”new Error()- if the user ID or guild ID is missing.
[JS] Example
Section titled “[JS] Example”const { create } = require("simply-xp");
const userId = "326815959358898189";const guildId = "867999056172052551";
create(userId, guildId) .then(console.log) // Returns true for a new user, undefined for an existing one .catch((err) => console.log(err)); // Returns the error