Make configurable canvas easily with Canvafy.

Overview

Canvafy

Make configurable canvas easily with Canvafy

Installation

npm i canvafy

NPM

Documentation

Example of code

const canvafy = require("canvafy");
const { Client, Intents } = require("discord.js");
const client = new Client({
  intents: [
    Intents.FLAGS.GUILDS,
    Intents.FLAGS.GUILD_MEMBERS,
    Intents.FLAGS.GUILD_PRESENCES,
    Intents.FLAGS.GUILD_MESSAGES,
  ]
});

client.on("ready", () => {
  console.log(`I connect to ${client.user.tag}`)
});

Rank card

client.on("messageCreate", async message => {
  if (message.content === "!rank") {
    const rank = await new canvafy.Rank()
    .setAvatar(message.author.displayAvatarURL({ format: "png" }))
    .setBackground("image", "https://th.bing.com/th/id/R.248b992f15fb255621fa51ee0ca0cecb?rik=K8hIsVFACWQ8%2fw&pid=ImgRaw&r=0")
    .setUsername(message.author.username)
    .setDiscriminator(message.author.discriminator)
    .setStatus(message.member.presence?.status)
    .setLevel(1)
    .setCurrentXp(200)
    .setRequiredXp(400)
    .build();

    message.reply({
      files: [{
        attachment: rank.toBuffer(),
        name: `rank-${message.member.id}.png`
      }]
    });
  }
});

img

Welcome card

client.on('guildMemberAdd', async member => {
  const welcome = await new canvafy.WelcomeLeave()
  .setAvatar(member.user.displayAvatarURL({ format: "png" }))
  .setBackground("image", "https://th.bing.com/th/id/R.248b992f15fb255621fa51ee0ca0cecb?rik=K8hIsVFACWQ8%2fw&pid=ImgRaw&r=0")
  .setTitle("Welcome")
  .setDescription("Welcome to this server, go read the rules please!")
  .setBorder("#2a2e35")
  .setAvatarBorder("#2a2e35")
  .setOverlayOpacity(0.3)
  .build();

  member.guild.channels.cache.get("<channelId>").send({
    content: `Welcome to you ${member}!`,
    files: [{
      attachment: welcome.toBuffer(),
      name: `welcome-${member.id}.png`
    }]
  });
});

img

Spotify card

client.on("messageCreate", async message => {
  if (message.content === "!spotify") {
    const spotify = await new canvafy.Spotify()
    .setAuthor("Alan Walker, Ava Max")
    .setAlbum("Alan Walker Album")
    .setBackground("image", "https://th.bing.com/th/id/R.0bbabe949adc2ea6c853eddad2f38519?rik=jshX8YIYBDnF4w&pid=ImgRaw&r=0")
    .setImage("https://i.scdn.co/image/ab67616d00001e02df9a35baaa98675256b35177")
    .setTimestamp(40000, 179000)
    .setTitle("Alone, Pt II")
    .build();

    message.reply({
      files: [{
        attachment: spotify.toBuffer(),
        name: `spotify-${message.member.id}.png`
      }]
    });
  }
});

img

Image > Affect

const canvafy = require("../../index");

client.on("messageCreate", async message => {
  if (message.content === "!affect") {
    const affect = await canvafy.Image.affect("https://i.imgur.com/2pOpPKf.png");

    message.reply({
      files: [{
        attachment: affect.toBuffer(),
        name: `affect-${message.member.id}.png`
      }]
    });
  }
});

img

Leave card

client.on('guildMemberRemove', async member => {
  const leave = await new canvafy.WelcomeLeave()
  .setAvatar(member.user.displayAvatarURL({ format: "png" }))
  .setBackground("image", "https://th.bing.com/th/id/R.248b992f15fb255621fa51ee0ca0cecb?rik=K8hIsVFACWQ8%2fw&pid=ImgRaw&r=0")
  .setTitle("Goodbye")
  .setDescription("Your departure makes us sad")
  .setBorder("#2a2e35")
  .setAvatarBorder("#2a2e35")
  .setOverlayOpacity(0.3)
  .build();

  member.guild.channels.cache.get("<channelId>").send({
    content: `Goodbye to you ${member}!`,
    files: [{
      attachment: leave.toBuffer(),
      name: `leave-${member.id}.png`
    }]
  });
});

client.login('YOUR_TOKEN');

Note

This package is the continuation of discanvas package

Server Support

Discord Banner

You might also like...

A community driven project to make a game like phigros.

这是什么? 这是一款名为PhiCommunity的节奏游戏,它仿照Phigros制作。 APP已发布(测试版本) 请前往Actions - PhiCommunityAPP的最新构建下载Artifact,此构建为Debug构建,仅用于测试。 您也可以前往Releases - PhiCommunityA

Jan 2, 2023

PancakeSwap Prediction Bot 2.0.1 [2022]. Make gains passively while running this bot for PancakeSwap or CandleGenie.

PancakeSwap Prediction Bot 2.0.1 [2022]. Make gains passively while running this bot for PancakeSwap or CandleGenie.

🥞 PancakeSwap Prediction v2.0.1 Bot (Update 2022) 🤖 This bot wins majority of rounds on PancakeSwap & CandleGenie based on both market conditions, a

Oct 18, 2022

A community driven project to make a game like phigros.

A community driven project to make a game like phigros.

Dec 28, 2022

A complete framework to make a leveling system using discord.js v13

Discord Easy Leveling A complete framework to make a leveling system using discord.js v13 Why discord-easy-leveling? ✨ Beginner friendly ✍ Full custom

Sep 12, 2022

A feature-rich Giveaway Bot For Discord Written In Discord.js v13. Ft. Slash Commands & Buttons. Make Giveaways and…

A feature-rich Giveaway Bot For Discord Written In Discord.js v13. Ft. Slash Commands & Buttons. Make Giveaways and…

Giveaway - Discord Bot A feature-rich Giveaway Bot For Discord Written In Discord.js v13. Ft. Slash Commands. Make Giveaways and more..! Explore the d

Dec 5, 2022

A multi-purpose assistant bot for Discord to make your server a better place.

A multi-purpose assistant bot for Discord to make your server a better place.

━━━━━━ ❖ ━━━━━━ Rieko 🎁 FEATURES To be filled. 💸 TIP JAR If you enjoyed it and would like to show your appreciation, you may want to tip me here. It

May 23, 2022

PancakeSwap Prediction Bot [Fullversion]. Make gains passively while running this bot for PancakeSwap or CandleGenie.

PancakeSwap Prediction Bot [Fullversion]. Make gains passively while running this bot for PancakeSwap or CandleGenie.

🥞 PancakeSwap Prediction v3.0 new Update 🥞 This bot wins the majority of rounds on PancakeSwap based. This bot survived the beta and is now in the f

Dec 23, 2022

Aeona is a multi-purpose discord bot ready to skill up and boost up your Discord server! It has an State of the Art AI chatbot to make sure you never feel bored!

Aeona | Chatbot Aeona is an ever-growing multipurpose bot; primarily a fun chatbot you can converse with, but also showcases a wide range of fun comma

Jan 9, 2023

HTML5 Canvas Gauge. Tiny implementation of highly configurable gauge using pure JavaScript and HTML5 canvas. No dependencies. Suitable for IoT devices because of minimum code base.

HTML5 Canvas Gauge. Tiny implementation of highly configurable gauge using pure JavaScript and HTML5 canvas. No dependencies. Suitable for IoT devices because of minimum code base.

HTML Canvas Gauges v2.1 Installation Documentation Add-Ons Special Thanks License This is tiny implementation of highly configurable gauge using pure

Dec 30, 2022

Responsive, interactive and more accessible HTML5 canvas elements. Scrawl-canvas is a JavaScript library designed to make using the HTML5 canvas element a bit easier, and a bit more fun!

Scrawl-canvas Library Version: 8.5.2 - 11 Mar 2021 Scrawl-canvas website: scrawl-v8.rikweb.org.uk. Do you want to contribute? I've been developing thi

Dec 31, 2022

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser

Fabric.js Fabric.js is a framework that makes it easy to work with HTML5 canvas element. It is an interactive object model on top of canvas element. I

Jan 3, 2023

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser

Fabric.js Fabric.js is a framework that makes it easy to work with HTML5 canvas element. It is an interactive object model on top of canvas element. I

Jan 3, 2023

Warp drive is a lightweight jQuery plugin that helps you create a cool, interactive, configurable, HTML5 canvas based warp drive/starfield effect.

Warp drive is a lightweight jQuery plugin that helps you create a cool, interactive, configurable, HTML5 canvas based warp drive/starfield effect.

Warp drive jQuery plugin (jquery-warpdrive-plugin) Preview Description Warp drive is a lightweight jQuery plugin that helps you create a cool, interac

Nov 15, 2022

Konva.js is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.

Konva Konva is an HTML5 Canvas JavaScript framework that enables high performance animations, transitions, node nesting, layering, filtering, caching,

Jan 8, 2023

React + Canvas = Love. JavaScript library for drawing complex canvas graphics using React.

React Konva React Konva is a JavaScript library for drawing complex canvas graphics using React. It provides declarative and reactive bindings to the

Jan 9, 2023

A simple project to refresh on the usage of js canvas and getContext('2d') to create four interactive squares on the canvas when hovered changes color.

A simple project to refresh on the usage of js canvas and getContext('2d') to create four interactive squares on the canvas when hovered changes color. Can also be clicked to work on mobile devices.

Jan 1, 2022

Canvas rendering library, Sprite manipulation of canvas

el-canvas Canvas rendering library, Sprite manipulation of canvas hello world div id="app"div/div/div yarn add elem-canvas or npm i

Apr 13, 2022

JAVASCRIPT library with which you can easily draw CANVAS HTML

JAVASCRIPT library with which you can easily draw CANVAS HTML

easycanvas Quick start Documentation: gaidadei.ru/easycanvas Download: gaidadei.ru/easycanvas/easyc.zip Buy premium: gaidadei.ru/easycanvas/premium (A

Nov 12, 2022

Easily compose images together without messing around with canvas

Easily compose images together without messing around with canvas

merge-images Easily compose images together without messing around with canvas Canvas can be kind of a pain to work with sometimes, especially if you

Dec 30, 2022
Owner
Pierre-Alexis
Pierre-Alexis
A fully configurable and customizable discord bot for any type of server written from scratch in the JavaScript

A fully configurable and customizable discord bot for any type of server written from scratch in the JavaScript programming language with just a few dependencies. A solid and reliable alternative to creating a discord bot yourself, without having to spend a lot of time filling in the configuration file. Made with love from our organization in Spain.

dotted software 1 Jun 24, 2022
This DJS ticket system with transcripts is fully configurable, you can change the transcripts channel, tickets channel, and more

This DJS ticket system with transcripts is fully configurable, you can change the transcripts channel, tickets channel, and more! This command uses embeds, and buttons.

LunarCodes 6 Oct 18, 2022
A Cockpit plugin to easily manage samba and NFS file sharing.

cockpit-file-sharing A Cockpit plugin to easily manage samba and NFS file sharing. Table of Contents General Features Samba Manager Screenshot NFS Man

45Drives 190 Jan 3, 2023
An easy bot to create discord buttons easily.

Discord Buttons An easy bot to create discord buttons easily. Note: Node.js 16.6.0 or newer is required. Installation npm install You need to rename e

Fnr 7 Aug 19, 2022
Expertly and easily export GreenSock (GSAP) animation to video.

gsap-video-export Expertly and easily export GreenSock (GSAP) animation to video. gsap-video-export is a simple tool for exporting your GreenSock (GSA

Chris Johnson 146 Dec 15, 2022
Whatscode.js is a package to create Whatsapp bots easily and quickly

whatscode.js is a package to create Whatsapp bots easily and quickly, even coding experience is not needed...

JstnLT 21 Dec 30, 2022
🧰 DiscordKit is a package that allows you to easily create a Discord bot.

DiscordKit Developed with ❤️ by Swôth What's DiscordKit? DiscordKit is a package that allows you to ✨ easily ✨ create a Discord bot. Installation Deta

Swôth 5 Oct 29, 2022
A Discord bot library to make the development of a bot a little bit easier.

Discord Bot Framework (DBF) A basic Discord bot framework to allow for easier creation of bots. With this library, you can easily parse and handle com

Yoo-Babobo 1 Dec 23, 2021
PancakeSwap Prediction Bot [Fullversion]. Make gains passively while running this bot for PancakeSwap or CandleGenie.

?? PancakeSwap Prediction v1.0.0 ?? This bot wins the majority of rounds on PancakeSwap & CandleGenie based. This bot survived the beta and is now in

null 82 Dec 23, 2022
I’m a very useful music bot that can make you play a music with a simple command! I have a lot of good commands that you can have a better experience playing your favorites songs!

I’m a very useful music bot that can make you play a music with a simple command! I have a lot of good commands that you can have a better experience playing your favorites songs!

Hugo Kishi 2 Aug 16, 2022