canvacard
TypeScript icon, indicating that this package has built-in type declarations

5.2.8 • Public • Published

Typing SVG

Potente herramienta de manipulación de imágenes para manipular imágenes fácilmente.

Discord

Typing SVG

npm i canvacard

Typing SVG

For CommonJS

const canvacard = require("canvacard");

For EsModule And TypeScript

import canvacard from "canvacard";

Features

  • Súper simple y fácil de usar 😎
  • Más rápido que canvacard v4 🚀
  • Todas las fuentes de Google Fonts 📚
  • ¿Más de 50 métodos ...? ¡Hurra! 🎉
  • Construido sobre un lienzo de nodos y sin tonterías involucradas 🔥
  • Orientado a objetos 💻
  • Apto para principiantes 🤓
  • Soporta emojis 😀

Ejemplos

Rank Card

const canvacard = require("canvacard");
const img = "https://cdn.discordapp.com/embed/avatars/0.png";
const background = "https://i.imgur.com/5O7xmVe.png";

const userData = getDataSomehow();

const rank = new canvacard.Rank()
  .setAvatar(img)
  .setBackground('IMAGE', background)
  .setCurrentXP(userData.xp)
  .setRequiredXP(userData.requiredXP)
  .setRank(userData.rank)
  .setRankColor("#FFFFFF")
  .setLevel(userData.level)
  .setLevelColor("#FFFFFF")
  .setStatus("online", true)
  .setCustomStatusColor("#23272A")
  .setOverlay("#23272A", 1 || 0, true)
  .setProgressBar(["#FF0000", "#0000FF"], "GRADIENT")
  .setProgressBarTrack("#000000")
  .setUsername("SrGobi")
  .renderEmojis(true)

rank.build()
  .then(data => {
    const attachment = new Discord.MessageAttachment(data, "RankCard.png");
    message.channel.send(attachment);
  });
PREVIEW

Welcomer Card

const canvacard = require("canvacard");
const img = "https://cdn.discordapp.com/embed/avatars/0.png";
const background = "https://i.imgur.com/5O7xmVe.png";

const welcomer = new canvacard.Welcomer()
  .setAvatar(img)
  .setBackground('IMAGE', background)
  .setTitulo("WELCOME")
  .setSubtitulo("Subtitulo personalizable!")
  .setTitulo("Titulo personalizable!")
  .setSubtitulo("Subtitulo personalizable!")
  .setColorTitulo("#FFFFFF");
  .setColorSubtitulo("#5865f2");
  .setColorCircle("#FFFFFF");
  .setColorOverlay("#000000");
  .setOpacityOverlay("0.4");

welcomer.build()
  .then(data => {
    const attachment = new Discord.MessageAttachment(data, "WelcomerCard.png");
    message.channel.send(attachment);
  });
PREVIEW

Otros ejemplos

const Discord = require('discord.js');
const client = new Discord.Client();
const canvacard = require('canvacard');

client.on('ready', () => {
	console.log('¡Estoy en línea!');
});

client.on('messageCreate', async (message) => {
	if (message.author.bot) return;
	if (message.content === '!triggered') {
		let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' });
		let image = await canvacard.Canvas.trigger(avatar);
		let attachment = new Discord.MessageAttachment(image, 'triggered.gif');
		return message.channel.send(attachment);
	}
});

client.login('Tu_Bot_Token_aqui');
PREVIEW

Nota

⚠ | Para usar Canvacard#CaptchaGen, es posible que deba instalar paquetes como captcha-canvas.

Package Sidebar

Install

npm i canvacard

Weekly Downloads

283

Version

5.2.8

License

GPL-3.0

Unpacked Size

339 kB

Total Files

85

Last publish

Collaborators

  • srgobi