fetch()
この関数は、データベースからユーザーを取得するために使用します。
パラメーター
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | string | ✅ | ユーザーの ID。 |
| guildId | string | ✅ | ユーザーが属するギルドの ID。 |
| username | string | ❌ | auto_create が有効な場合に使うユーザー名。 |
戻り値
- Promise<
User>
例外
XpFatal- 無効なパラメーターが渡された場合。
[JS] 例
const {fetch} = require('simply-xp');
const userId = "326815959358898189";
const guildId = "867999056172052551";
const username = "Abadima";
fetch(userId, guildId, username)
.then(console.log) // Returns the user object
.catch((err) => console.log(err)); // Returns the error