Aller au contenu
Sur cette page

leaderboard()

Ce contenu n’est pas encore disponible dans votre langue.

This function is used to generate an array of the top users in a guild.

If guildId is omitted, leaderboard() builds a global leaderboard by keeping the highest-XP entry for each user across all guilds.

Parameter Type Required Default Description
guildId string ❌ The guild ID for the leaderboard.
limit number ❌ ♾️ The limit of the leaderboard.

If provided, limit must be a positive integer greater than 0.

  • XpFatal - if invalid parameters are provided.
const { leaderboard } = require("simply-xp");
const guildid = "867999056172052551"; // Use undefined for global leaderboard
const limit = 10;
leaderboard(guildid, limit)
.then(console.log) // Returns the leaderboard array
.catch((err) => console.log(err)); // Returns the error