fetchバージョン: v2.0
目次
fetch()
この関数は、データベースからユーザーを取得するために使用します。
パラメーター
Section titled “パラメーター”| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | string | ✅ | ユーザーの ID。 |
| guildId | string | ✅ | ユーザーが属するギルドの ID。 |
| username | string | ❌ | auto_create が有効な場合に使うユーザー名。 |
- Promise<
User>
XpFatal- 無効なパラメーターが渡された場合。
[JS] 例
Section titled “[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