create()
この関数は、データベース内にユーザーを作成するために使用します。
パラメーター
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | string | ✅ | ユーザーの ID。 |
| guildId | string | ✅ | ギルド ID。 |
| username | string | ✅ | ユーザー名。 |
戻り値
- Promise<
UserResult>
例外
XpFatal- 無効なパラメーターが渡された場合。
[JS] 例
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