🖼️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
Param | Type | Description |
---|---|---|
user |
| User object |
user.bot |
| If the user is a bot |
user.id |
| User ID |
user.flags |
| User Badges |
user.discriminator |
| User Discriminator |
options |
| Object of options |
options.customBadges |
| Custom Badges |
options.overwriteBadges |
| Overwrite the badges |
genBase ⇒ Promise.<Buffer>
Promise.<Buffer>
Generate the card background
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
Param | Type | Description |
---|---|---|
options |
| Object of options |
avatarData |
| Avatar URL |
bannerData |
| Banner URL |
genFrame ⇒ Promise.<Buffer>
Promise.<Buffer>
Generate the card frame
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
Param | Type |
---|---|
badgesData |
|
badgesData.canvas |
|
badgesData.badgesLength |
|
options |
|
options.badgesFrame |
|
genBorder ⇒ Promise.<Buffer>
Promise.<Buffer>
Generate the edges of the card with a multi-color gradient
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
Param | Type | Description |
---|---|---|
options |
| Options object |
options.borderColor |
| It can be a color or an array of colors |
options.borderAllign |
| Edge direction ('vertical' or 'horizontal') |
genTextAndAvatar ⇒ Promise.<Buffer>
Promise.<Buffer>
Generate the card text and avatar
Kind: global variable
Param | Type | Default | Description |
---|---|---|---|
user |
| User data | |
user.username |
| User name | |
user.discriminator |
| User discriminator | |
user.bot |
| If the user is a bot | |
user.createdTimestamp |
| User creation timestamp | |
user.id |
| User ID | |
options |
| Options object | |
options.customUsername |
| Custom username | |
options.usernameColor |
| Username color | |
options.customSubtitle |
| Custom subtitle | |
options.subtitleColor |
| Subtitle color | |
options.customDate |
| Custom date | |
options.localDateType |
| Local format for the date, for example, 'en' | |
options.customTag |
| Custom tag | |
options.tagColor |
| HEX Color of the label | |
options.squareAvatar |
| Change the shape of the avatar to a square | |
options.presenceStatus |
| Show presence status | |
rankData |
| Range data | |
avatarData |
| Avatar URL | |
[font] |
|
| Typeface family |
genAvatarFrame ⇒ Promise.<Buffer>
Promise.<Buffer>
This function generates the avatar frame
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
Param | Type | Description |
---|---|---|
user |
| User data |
user.avatar_decoration_data |
| Avatar decoration data |
user.avatar_decoration_data.asset |
| Avatar decoration asset |
options |
| Object of options |
options.presenceStatus |
| User presence |
cutAvatarStatus ⇒ Promise.<Buffer>
Promise.<Buffer>
This function cuts the presence status on the card
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
Param | Type | Description |
---|---|---|
canvasToEdit |
| Image or canvas to edit |
options |
| Object of options |
options.presenceStatus |
| User presence |
genStatus ⇒ Promise.<Buffer>
Promise.<Buffer>
Sets the presence status on the card
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
Param | Type | Description |
---|---|---|
canvasToEdit |
| Image or canvas to edit |
options |
| Object of options |
options.presenceStatus |
| User presence |
genBotVerifBadge ⇒ Promise.<Buffer>
Promise.<Buffer>
Generate the bot verification badge
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
Param | Type | Default | Description |
---|---|---|---|
user |
| User object | |
user.username |
| User name | |
user.flags |
| Numeric value of the user flags | |
[font] |
|
| Typeface family |
addShadow ⇒ Promise.<Buffer>
Promise.<Buffer>
Shadows for the canvas
Kind: global variable
Returns: Promise.<Buffer>
- Canvas
Param | Type | Description |
---|---|---|
canvasToEdit |
| Image or canvas to edit |
genXpBar(options) ⇒ Promise.<Buffer>
Promise.<Buffer>
Generate the experience bar
Kind: global function
Returns: Promise.<Buffer>
- Canvas
Param | Type | Description |
---|---|---|
options |
| Options object |
options.rankData |
| Rank data |
options.rankData.currentXp |
| User current XP |
options.rankData.requiredXp |
| XP required to level up |
options.rankData.level |
| User level |
options.rankData.rank |
| User rank |
options.rankData.barColor |
| Color of the XP bar |
options.rankData.levelColor |
| Color of the level text |
options.rankData.autoColorRank |
| Automatically color the rank |
Last updated