🖼️Canvas

Members

generateBadgesCanvasPromise.<Buffer>

Generate the badge canvas

genBasePromise.<Buffer>

Generate the card background

genFramePromise.<Buffer>

Generate the card frame

genBorderPromise.<Buffer>

Generate the edges of the card with a multi-color gradient

genTextAndAvatarPromise.<Buffer>

Generate the card text and avatar

genAvatarFramePromise.<Buffer>

This function generates the avatar frame

cutAvatarStatusPromise.<Buffer>

This function cuts the presence status on the card

genStatusPromise.<Buffer>

Sets the presence status on the card

genBotVerifBadgePromise.<Buffer>

Generate the bot verification badge

addShadowPromise.<Buffer>

Shadows for the canvas

Functions

genXpBar(options)Promise.<Buffer>

Generate the experience bar

generateBadgesCanvas ⇒ Promise.<Buffer>

Generate the badge canvas

Kind: global variable Returns: Promise.<Buffer> - Canvas

ParamTypeDescription

user

Object

User object

user.bot

string

If the user is a bot

user.id

string

User ID

user.flags

Object

User Badges

user.discriminator

string

User Discriminator

options

Object

Object of options

options.customBadges

Array.<string>

Custom Badges

options.overwriteBadges

boolean

Overwrite the badges

genBase ⇒ Promise.<Buffer>

Generate the card background

Kind: global variable Returns: Promise.<Buffer> - Canvas

ParamTypeDescription

options

Object

Object of options

avatarData

string

Avatar URL

bannerData

string

Banner URL

genFrame ⇒ Promise.<Buffer>

Generate the card frame

Kind: global variable Returns: Promise.<Buffer> - Canvas

ParamType

badgesData

Object

badgesData.canvas

CanvasElemet

badgesData.badgesLength

string

options

Object

options.badgesFrame

string

genBorder ⇒ Promise.<Buffer>

Generate the edges of the card with a multi-color gradient

Kind: global variable Returns: Promise.<Buffer> - Canvas

ParamTypeDescription

options

Object

Options object

options.borderColor

string | Array.<string>

It can be a color or an array of colors

options.borderAllign

string

Edge direction ('vertical' or 'horizontal')

genTextAndAvatar ⇒ Promise.<Buffer>

Generate the card text and avatar

Kind: global variable

ParamTypeDefaultDescription

user

Object

User data

user.username

string

User name

user.discriminator

string

User discriminator

user.bot

boolean

If the user is a bot

user.createdTimestamp

number

User creation timestamp

user.id

string

User ID

options

Object

Options object

options.customUsername

string

Custom username

options.usernameColor

string

Username color

options.customSubtitle

string

Custom subtitle

options.subtitleColor

string

Subtitle color

options.customDate

string | Date

Custom date

options.localDateType

string

Local format for the date, for example, 'en'

options.customTag

string

Custom tag

options.tagColor

string

HEX Color of the label

options.squareAvatar

boolean

Change the shape of the avatar to a square

options.presenceStatus

boolean

Show presence status

rankData

Object

Range data

avatarData

string

Avatar URL

[font]

string

"&quot;Arial&quot;"

Typeface family

genAvatarFrame ⇒ Promise.<Buffer>

This function generates the avatar frame

Kind: global variable Returns: Promise.<Buffer> - Canvas

ParamTypeDescription

user

Object

User data

user.avatar_decoration_data

Object

Avatar decoration data

user.avatar_decoration_data.asset

string

Avatar decoration asset

options

Object

Object of options

options.presenceStatus

string

User presence

cutAvatarStatus ⇒ Promise.<Buffer>

This function cuts the presence status on the card

Kind: global variable Returns: Promise.<Buffer> - Canvas

ParamTypeDescription

canvasToEdit

Image | Canvas

Image or canvas to edit

options

Object

Object of options

options.presenceStatus

string

User presence

genStatus ⇒ Promise.<Buffer>

Sets the presence status on the card

Kind: global variable Returns: Promise.<Buffer> - Canvas

ParamTypeDescription

canvasToEdit

Image | Canvas

Image or canvas to edit

options

Object

Object of options

options.presenceStatus

string

User presence

genBotVerifBadge ⇒ Promise.<Buffer>

Generate the bot verification badge

Kind: global variable Returns: Promise.<Buffer> - Canvas

ParamTypeDefaultDescription

user

Object

User object

user.username

string

User name

user.flags

number

Numeric value of the user flags

[font]

string

"&quot;Arial&quot;"

Typeface family

addShadow ⇒ Promise.<Buffer>

Shadows for the canvas

Kind: global variable Returns: Promise.<Buffer> - Canvas

ParamTypeDescription

canvasToEdit

Image | Canvas

Image or canvas to edit

genXpBar(options) ⇒ Promise.<Buffer>

Generate the experience bar

Kind: global function Returns: Promise.<Buffer> - Canvas

ParamTypeDescription

options

Object

Options object

options.rankData

Object

Rank data

options.rankData.currentXp

number

User current XP

options.rankData.requiredXp

number

XP required to level up

options.rankData.level

number

User level

options.rankData.rank

number

User rank

options.rankData.barColor

string | Array.<string>

Color of the XP bar

options.rankData.levelColor

string

Color of the level text

options.rankData.autoColorRank

boolean

Automatically color the rank

Last updated