leaderboardCard()
This function is used to generate an image of the server's leaderboard.
Parametersβ
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
data | ArrayUser | β | The array of users. | |
options | LeaderboardCardOptions | β | {} | The options for the leaderboard card. |
guildInfo | {name: string, imageURL: URL, memberCount: number} | β | {} | The guild info. |
locales | LeaderboardCardLocales | β | {} | The locales for the leaderboard card. |
Returnsβ
- Promise<
{ attachment: Buffer; description: string; name: string; }
>
Throwsβ
XpFatal
- if invalid parameters are provided.
[JS] Exampleβ
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