leaderboardCard()
この関数は、サーバーのランキング画像を生成するために使用します。
パラメーター
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| data | ArrayUser | ✅ | ユーザー配列。 | |
| options | LeaderboardCardOptions | ❌ | {} | leaderboardCard のオプション。 |
| guildInfo | {name: string, imageURL: URL, memberCount: number} | ❌ | {} | ギルド情報。 |
| locales | LeaderboardCardLocales | ❌ | {} | 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