Skip to main content

leaderboardCard()

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

Parameters​

ParameterTypeRequiredDefaultDescription
dataArrayUserβœ…The array of users.
optionsLeaderboardCardOptions❌{}The options for the leaderboard card.
guildInfo{name: string, imageURL: URL, memberCount: number}❌{}The guild info.
localesLeaderboardCardLocales❌{}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