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

leaderboardCard()

この関数は、サーバーのランキング画像を生成するために使用します。

パラメーター

ParameterTypeRequiredDefaultDescription
dataArrayUserユーザー配列。
optionsLeaderboardCardOptions{}leaderboardCard のオプション。
guildInfo{name: string, imageURL: URL, memberCount: number}{}ギルド情報。
localesLeaderboardCardLocales{}leaderboardCard のローカライズ文言。

戻り値

  • Promise<{ attachment: Buffer; description: string; name: string; }>

例外

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

[JS] 例

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

const guildId = "867999056172052551";

leaderboardCard(await leaderboard(guildId))
.then(console.log) // Returns the leaderboard card object
.catch((err) => console.log(err)); // Returns the error