rank()
This function is used to generate an image of a user's rank.
warning
This function is replaced by rankCard() in Version 2
Parametersβ
| Parameter | Type | Required | Description |
|---|---|---|---|
| message | Message | β | The message object. |
| userId | string | β | The ID of the user. |
| guildId | string | β | The guild ID. |
| options | RankCardOptions | β | The options. |
Returns Promise<<MessageAttachment>>β

Throwsβ
new Error()- if invalid parameters are provided, or we are unable to fetch the user's avatar.
[JS] Exampleβ
const {rank} = require('simply-xp');
const userId = "326815959358898189";
const guildId = "867999056172052551";
rank(message, userId, guildId)
.then(console.log) // Returns the rank card object
.catch((err) => console.log(err)); // Returns the error
Rank Optionsβ
| Option | Type | Required | Description |
|---|---|---|---|
| background | URL | β | The background image. |
| color | HEX | β | The color. |