@k11960/discord-jimp
v2.0.4
Published
Image generator with Jimp.
Downloads
9
Readme
discord-jimp
yarn
yarn add --no-bin-links @k1-1960/discord-jimp
npm
npm i --no-bin-links @k1-1960/discord-jimp
WelcomeCard
ESM
import { AttachmentBuilder } from "discord.js";
import { WelcomeCard as WelcomeCardBuilder } from "@k1-1960/discord-jimp";
const WelcomeCard = new WelcomeCardBuilder({
username: "K1_1960",
title: "Bienvenid@",
subtitle: "Ahora somos 15 miembros!",
avatar:
"https://cdn.discordapp.com/avatars/838091364344397835/84ad1de4bb1b2a485a2a4584e4804efd.png?size=2048",
background:
"https://cdn.discordapp.com/attachments/1122455580381028402/1122456268683096167/29364-1920x1080.jpg",
});
async function main() {
await WelcomeCard.build();
const attachment = new AttachmentBuilder(await WelcomeCard.buffer());
channel.send({
files: [attachment]
});
}
main();
CJS
const { AttachmentBuilder } = require("discord.js");
const { WelcomeCard: WelcomeCardBuilder} = require("@k1-1960/discord-jimp");
const WelcomeCard = new WelcomeCardBuilder({
username: "K1_1960",
title: "Bienvenid@",
subtitle: "Ahora somos 15 miembros!",
avatar:
"https://cdn.discordapp.com/avatars/838091364344397835/84ad1de4bb1b2a485a2a4584e4804efd.png?size=2048",
background:
"https://cdn.discordapp.com/attachments/1122455580381028402/1122456268683096167/29364-1920x1080.jpg",
});
async function main() {
await WelcomeCard.build();
const attachment = new AttachmentBuilder(await WelcomeCard.buffer());
channel.send({
files: [attachment]
});
}
main();
The output looks something like this:
RankCard
ESM
import { AttachmentBuilder } from "discord.js";
import { RankCard as RankCardBuilder } from "@k1-1960/discord-jimp";
const RankCard = new RankCardBuilder({
username: "K1_1960",
title: "Rank",
level: "Level 0",
progress: "512 / 1500", // progress.
avatar:
"https://cdn.discordapp.com/avatars/838091364344397835/84ad1de4bb1b2a485a2a4584e4804efd.png?size=2048",
background:
"https://cdn.discordapp.com/attachments/1122455580381028402/1122456268683096167/29364-1920x1080.jpg",
color: "#5C6BC0", // progress bar color
});
async function main() {
await RankCard.build();
const attachment = new AttachmentBuilder(await RankCard.buffer());
channel.send({
files: [attachment]
});
}
main();
CJS
const { AttachmentBuilder } = require("discord.js");
const { RankCard: RankCardBuilder } = require("@k1-1960/discord-jimp");
const RankCard = new RankCardBuilder({
username: "K1_1960",
title: "Rank",
level: "Level 0",
progress: "512 / 1500", // progress.
avatar:
"https://cdn.discordapp.com/avatars/838091364344397835/84ad1de4bb1b2a485a2a4584e4804efd.png?size=2048",
background:
"https://cdn.discordapp.com/attachments/1122455580381028402/1122456268683096167/29364-1920x1080.jpg",
color: "#5C6BC0", // progress bar color
});
async function main() {
await RankCard.build();
const attachment = new AttachmentBuilder(await RankCard.buffer());
channel.send({
files: [attachment]
});
}
main();
The output looks something like this: