๐จWelcome / Leave
Classes
Functions
setAvatar(value) โ WelcomeLeave
Set the avatar of the card
setTitulo(value, color) โ WelcomeLeave
Set the title of the card
setSubtitulo(value, color) โ WelcomeLeave
Set the subtitle of the card
setColorCircle(value) โ WelcomeLeave
Set the color of the circle
setColorOverlay(value) โ WelcomeLeave
Set the color of the overlay
setOpacityOverlay(value) โ WelcomeLeave
Set the opacity of the overlay
setBackground(type, data) โ WelcomeLeave
Set background image/color of the card
setTypeOverlay(type) โ WelcomeLeave
Set the type of overlay
build([font]) โ Promise.<Buffer>
Build the card
WelcomeLeave
Kind: global class
new WelcomeLeave()
Welcome or Leave card creator
Example
const welcome = new canvacard.WelcomeLeave()
.setAvatar(data.avatarURL)
.setBackground('COLOR', '#000000')
.setTitulo("Titulo de la Tarjeta๐", '#FFFFFF')
.setSubtitulo("Subtitulo de la Tarjeta ๐", '#FFFFFF')
.setOpacityOverlay(1)
.setColorCircle('#FFFFFF')
.setColorOverlay('#5865F2')
.setTypeOverlay('ROUNDED');
const welcomeImage = await welcome.build("Suravaram");
canvacard.write(welcomeImage, "./welcomer.png");setAvatar(value) โ WelcomeLeave
WelcomeLeaveSet the avatar of the card
Kind: global function
Returns: WelcomeLeave - The current instance of WelcomeLeave
Throws:
APIErrorMissing field: avatar
value
string | Buffer
Avatar URL or Buffer
setTitulo(value, color) โ WelcomeLeave
WelcomeLeaveSet the title of the card
Kind: global function
Returns: WelcomeLeave - The current instance of WelcomeLeave
Throws:
APIErrorThe title must be a string
value
string
Title value
color
string
HTML5 color code "#000000"
setSubtitulo(value, color) โ WelcomeLeave
WelcomeLeaveSet the subtitle of the card
Kind: global function
Returns: WelcomeLeave - The current instance of WelcomeLeave
Throws:
APIErrorThe subtitle must be a string
value
string
Subtitle value
color
string
HTML5 color code "#000000"
setColorCircle(value) โ WelcomeLeave
WelcomeLeaveSet the color of the circle
Kind: global function
Returns: WelcomeLeave - The current instance of WelcomeLeave
Throws:
APIErrorThe color must be a string
value
string
HTML5 color code "#000000"
setColorOverlay(value) โ WelcomeLeave
WelcomeLeaveSet the color of the overlay
Kind: global function
Returns: WelcomeLeave - The current instance of WelcomeLeave
Throws:
APIErrorThe color must be a string
value
string
HTML5 color code "#000000"
setOpacityOverlay(value) โ WelcomeLeave
WelcomeLeaveSet the opacity of the overlay
Kind: global function
Returns: WelcomeLeave - The current instance of WelcomeLeave
Throws:
APIErrorThe opacity must be a number
value
number
Opacity value (0 to 1)
setBackground(type, data) โ WelcomeLeave
WelcomeLeaveSet background image/color of the card
Kind: global function
Returns: WelcomeLeave - The current instance of WelcomeLeave
Throws:
APIErrorMissing field: data
type
"COLOR" | "IMAGE"
Type of background
data
string
Image URL or HTML color code
setTypeOverlay(type) โ WelcomeLeave
WelcomeLeaveSet the type of overlay
Kind: global function
Returns: WelcomeLeave - The current instance of WelcomeLeave
Throws:
APIErrorMissing field: type
type
"RECTANGLE" | "ROUNDED"
Type of overlay
build([font]) โ Promise.<Buffer>
Promise.<Buffer>Build the card
Kind: global function
Returns: Promise.<Buffer> - Card image in buffer format
Throws:
APIErrorError loading background image
[font]
string
"Arial"
Font to use in the card
Last updated


