コンテンツにスキップ
Version: v1.2
目次

rank()

このコンテンツはまだ日本語訳がありません。

This function is used to generate an image of a user’s rank.

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.
  • Promise<MessageAttachment>

Image

  • new Error() - if the user ID or guild ID is missing.
  • new Error() - NO_DATA, if the user has no record.
const { rank } = require("simply-xp");
const userId = "326815959358898189";
const guildId = "867999056172052551";
rank(message, userId, guildId)
.then((card) => message.reply({ files: [card] })) // Send the card
.catch((err) => console.log(err)); // Returns the error

Option Type Required Default Description
background URL ❌ gradient The background image.
color HEX ❌ #096DD1 The theme color.
lvlbar HEX ❌ #ffffff The color of the level bar.
lvlbarBg HEX ❌ #ffffff The color of the level bar’s background.