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

leaderboard()

この関数は、ギルド内の上位ユーザー配列を生成するために使用します。

guildId を省略すると、leaderboard() はすべてのギルドにまたがって各ユーザーの最高 XP エントリを保持し、グローバルランキングを構築します。

パラメーター

ParameterTypeRequiredDefaultDescription
guildIdstringランキング対象のギルド ID。
limitnumber♾️取得するランキング件数。

limit を指定する場合は、0 より大きい正の整数である必要があります。

戻り値

例外

  • XpFatal - 無効なパラメーターが渡された場合。

[JS] 例

const {leaderboard} = require('simply-xp');

const guildid = "867999056172052551"; // Use undefined for global leaderboard
const limit = 10;

leaderboard(guildid, limit)
.then(console.log) // Returns the leaderboard array
.catch((err) => console.log(err)); // Returns the error