1.0.2 • Published 3 years ago
jimp-static v1.0.2
jimp-static
Easy to use !!
You want to develop a discord bot using the Discord.js library and you want to integrate nice images in Canvas? jimp-static is made for you! You can create great welcome images, goodbye images and other fun images fully customizable using the many easy-to-use features!
Installation
$ npm install --save jimp-static
Example Brightness
const Discord = require("discord.js");
const client = new Discord.Client();
const Jimp = require("jimp-static");
client.on("ready", () => {
console.log("I'm online!");
});
client.on("message", async (message) => {
if (message.author.bot) return;
if (message.content === "!brightness") {
const image = new Jimp.Brightness()
.setAvatar(message.author.displayAvatarURL({ dynamic: false, format: 'png' })) // Set the avatar for the image.
.setBrightness(100) // This can be between 0 - 200.
image.build().then(data => { // Build the image.
const attachment = new Discord.MessageAttachment(data, 'brightness.png'); // Set the image in a attachment.
return message.channel.send(attachment); // Send the image.
})
}
});
client.login("Your_Bot_Token_here");
Note
⚠ | In order to use
Canvacord#Welcomer
/Canvacord#Leaver
, you may need to install packages like discord-canvas.