๐ช Open source and no privacy concerns, fully transparent - Canvacard is open source and free. You can contribute and you don't have to worry about privacy.
๐ช Easy to use - Canvacard offers an intuitive and easy API to efficiently generate images, perfect for developers of all levels.
๐ Speed โโand optimization - The libraries it uses are highly optimized, offering exceptional performance when creating images.
๐ Typescript support - Canvacard is built in Typescript, which allows for the use of type definitions and improves the developer experience.
๐จ More than 50 customization options - You have access to many tools to completely adjust and modify your images or cards.
๐ผ๏ธ Creating interactive and personalized cards - Canvacard is perfect for creating custom cards for Discord, adding graphics, banners, badges, and more.
๐ ๏ธ Object Oriented Design - Canvacard is built with an object-oriented programming approach, making it easy to reuse and create complex cards.
๐ค Ideal for beginners - The API and documentation are simple, making it accessible even to those with little experience handling images.
๐ก Register fonts - Not only can you use the fonts from your machine, if you also use it for a server you can register the fonts you want!
For CommonJS
const { registerFont } =require("canvacard");// Path to source file and aliasconstfontPath="./path/to/font.ttf";constfontName="CustomFont";registerFont(fontPath, fontName);console.log(`Fuente ${fontName} registrada exitosamente.`);
constcanvacard=require("canvacard");constimg="https://cdn.discordapp.com/embed/avatars/0.png";constbackground="https://i.imgur.com/5O7xmVe.png";constwelcomer=newcanvacard.WelcomeLeave().setAvatar(img).setBackground('COLOR','#000000').setTitulo("Card Title ๐",'#FFFFFF').setSubtitulo("Card Caption ๐",'#FFFFFF').setOpacityOverlay(1).setColorCircle('#FFFFFF').setColorOverlay('#5865F2').setTypeOverlay('ROUNDED');welcomer.build("Cascadia Code PL, Noto Color Emoji").then(data => {// Use AttachmentBuilder to upload the fileconstattachment=newAttachmentBuilder(data, { name:"WelcomeCard.png" });message.channel.send({ content:"Here is your welcome card:", files: [attachment] }); }).catch(err =>console.error("Error creating welcome card:", err));
constcanvacard=require("canvacard");constspotify=newcanvacard.Spotify().setAuthor("SAIKO").setAlbum("SAKURA ๐").setStartTimestamp(Date.now() -10000).setEndTimestamp(Date.now() +50000).setImage("https://i.scdn.co/image/ab67616d00001e02e346fc6f767ca2ac8365fe60").setTitle("YO LO SOรร");spotify.build("Cascadia Code PL, Noto Color Emoji").then(data => {// Use AttachmentBuilder to upload the fileconstattachment=newAttachmentBuilder(data, { name:"SpotifyCard.png" });message.channel.send({ content:"Here is your spotify card:", files: [attachment] }); }).catch(err =>console.error("Error creating spotify card:", err));