Skip to content
On this page

leaderboardCard()

This function is used to generate an image of the server’s leaderboard.

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.
  • Promise<{ attachment: Buffer; description: string; name: string; }>
  • XpFatal - if invalid parameters are provided.
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