leaderboard()
This function is used to generate an array of the top users in a guild.
Parametersβ
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| guildID | string | β | The guild ID for the leaderboard. | |
| limit | number | β | βΎοΈ | The limit of the leaderboard. |
Returnsβ
- Promise<
User>
Throwsβ
XpFatal- if invalid parameters are provided.
[JS] Exampleβ
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