Skip to main content
Version: v1.3

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. | | βœ… | The user object. | | options | RankCardOptions | ❌ | The options. |

Returns Promise<<MessageAttachment>>​

Image

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​

OptionTypeRequiredDescription
backgroundURL❌The background image.
colorHEX❌The color.