Canvas
Members
generateBadgesCanvas ⇒ Promise.<Buffer>
Generate the badge canvas
genBase ⇒ Promise.<Buffer>
Generate the card background
genFrame ⇒ Promise.<Buffer>
Generate the card frame
genBorder ⇒ Promise.<Buffer>
Generate the edges of the card with a multi-color gradient
genTextAndAvatar ⇒ Promise.<Buffer>
Generate the card text and avatar
genAvatarFrame ⇒ Promise.<Buffer>
This function generates the avatar frame
cutAvatarStatus ⇒ Promise.<Buffer>
This function cuts the presence status on the card
genStatus ⇒ Promise.<Buffer>
Sets the presence status on the card
genBotVerifBadge ⇒ Promise.<Buffer>
Generate the bot verification badge
addShadow ⇒ Promise.<Buffer>
Shadows for the canvas
Functions
genXpBar(options) ⇒ Promise.<Buffer>
Generate the experience bar
generateBadgesCanvas ⇒ Promise.<Buffer>
Promise.<Buffer>
Generate the badge canvas
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
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>
Promise.<Buffer>
Generate the card background
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
options
Object
Object of options
avatarData
string
Avatar URL
bannerData
string
Banner URL
genFrame ⇒ Promise.<Buffer>
Promise.<Buffer>
Generate the card frame
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
badgesData
Object
badgesData.canvas
CanvasElemet
badgesData.badgesLength
string
options
Object
options.badgesFrame
string
genBorder ⇒ Promise.<Buffer>
Promise.<Buffer>
Generate the edges of the card with a multi-color gradient
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
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>
Promise.<Buffer>
Generate the card text and avatar
Kind: global variable
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
""Arial""
Typeface family
genAvatarFrame ⇒ Promise.<Buffer>
Promise.<Buffer>
This function generates the avatar frame
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
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>
Promise.<Buffer>
This function cuts the presence status on the card
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
canvasToEdit
Image
| Canvas
Image or canvas to edit
options
Object
Object of options
options.presenceStatus
string
User presence
genStatus ⇒ Promise.<Buffer>
Promise.<Buffer>
Sets the presence status on the card
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
canvasToEdit
Image
| Canvas
Image or canvas to edit
options
Object
Object of options
options.presenceStatus
string
User presence
genBotVerifBadge ⇒ Promise.<Buffer>
Promise.<Buffer>
Generate the bot verification badge
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
user
Object
User object
user.username
string
User name
user.flags
number
Numeric value of the user flags
[font]
string
""Arial""
Typeface family
addShadow ⇒ Promise.<Buffer>
Promise.<Buffer>
Shadows for the canvas
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
canvasToEdit
Image
| Canvas
Image or canvas to edit
genXpBar(options) ⇒ Promise.<Buffer>
Promise.<Buffer>
Generate the experience bar
Kind: global function
Returns: Promise.<Buffer>
- Canvas
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