🏆Rank

Classes

Rank

Functions

setAvatar(avatarUrl, AvatarDecorationData, squareAvatar)Rank

Set the user avatar

setBanner(bannerUrl, moreBackgroundBlur, disableBackgroundBlur, backgroundBrightness)Rank

Set the user banner

setBadges(flags, bot, frame, customBadges)Rank

Set the user badges and frame

setBorder(color, allign)Rank

Set the border of the card

setUsername(name, [discriminator], [color], customUsername, customTag)Rank

Set the username of the user

setCurrentXP(data, [color])Rank

Set the current experience

setRequiredXP(data, [color])Rank

Set the required experience

setRank(data, [text], [display])Rank

Set the user rank

setLevel(data, [text])Rank

Establece el nivel del usuario

setProgressBar(color, [fillType], [rounded])Rank

Set the progress bar

setStatus(presenceStatus)Rank

Set the user presence status

setCreatedTimestamp(timestamp, customDate)Rank

Set the user created timestamp

build([font])Promise.<Buffer>

Build the rank card

Rank

Kind: global class

new Rank(userId)

Rank card creator

PREVIEW

Example

const rank = new canvacard.Rank(data.id)
  .setAvatar(data.avatarURL, data.avatar_decoration_data.asset)
  .setBanner(data.bannerURL, true)
  .setBadges(data.flags, data.bot, true)
  .setBorder(["#22274a", "#001eff"], "vertical")
  .setCurrentXP(userData.xp)
  .setRequiredXP(userData.requiredXP)
  .setRank(1, "RANK", true)
  .setLevel(20, "LEVEL", true)
  .setStatus("online")
  .setProgressBar(["#14C49E", "#FF0000"], "GRADIENT", true)
  .setUsername(data.global_name, data.discriminator)
  .setCreatedTimestamp(data.createdTimestamp);

const rankImage = await rank.build("Cascadia Code PL");
canvacard.write(rankImage, "./rank.png");

setAvatar(avatarUrl, AvatarDecorationData, squareAvatar) ⇒ Rank

Set the user avatar

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

setBanner(bannerUrl, moreBackgroundBlur, disableBackgroundBlur, backgroundBrightness) ⇒ Rank

Set the user banner

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

setBadges(flags, bot, frame, customBadges) ⇒ Rank

Set the user badges and frame

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

setBorder(color, allign) ⇒ Rank

Set the border of the card

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

setUsername(name, [discriminator], [color], customUsername, customTag) ⇒ Rank

Set the username of the user

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

setCurrentXP(data, [color]) ⇒ Rank

Set the current experience

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

setRequiredXP(data, [color]) ⇒ Rank

Set the required experience

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

setRank(data, [text], [display]) ⇒ Rank

Set the user rank

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

setLevel(data, [text]) ⇒ Rank

Establece el nivel del usuario

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

setProgressBar(color, [fillType], [rounded]) ⇒ Rank

Set the progress bar

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

setStatus(presenceStatus) ⇒ Rank

Set the user presence status

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

setCreatedTimestamp(timestamp, customDate) ⇒ Rank

Set the user created timestamp

Kind: global function Returns: Rank - The current instance of Rank Throws:

  • APIError If the URL or asset is invalid

build([font]) ⇒ Promise.<Buffer>

Build the rank card

Kind: global function Returns: Promise.<Buffer> - Card image in buffer format Throws:

  • APIError Missing field: data

Last updated