メインコンテンツまでスキップ
バージョン: v2.0

fetch()

この関数は、データベースからユーザーを取得するために使用します。

パラメーター

ParameterTypeRequiredDescription
userIdstringユーザーの ID。
guildIdstringユーザーが属するギルドの ID。
usernamestringauto_create が有効な場合に使うユーザー名。

戻り値

例外

  • 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