discord-image-generation is a powerful module that allow you to generate awesome images.
A powerfull module that allow you to generate awesome images.
Feel free to report all bugs and glitches by creating an issue in the issue section.
A correct and understandable issue contains :
- Steps to reproduce
- Code that summonned the error
- The complete error
Please join this community server to follow all my projects or if you need help.


You can download it from npmjs.
``cli`
npm i discord-image-generation
The first step is to import the module in your code.
`js`
const DIG = require("discord-image-generation");
Then you have to request your image and send it as an attachement.
js
// Import the discord.js library.
const Discord = require("discord.js");
// Create a new discord.js client.
const bot = new Discord.Client();const DIG = require("discord-image-generation");
// Listen to the ready event
bot.on("ready", () => {
console.log("Bot is online");
});
// Listen to the message event
bot.on("messageCreate", async (message) => {
// Send the image in a simple message
if (message.content === "*delete") {
// Get the avatarUrl of the user
let avatar = message.author.displayAvatarURL({
dynamic: false,
format: 'png'
});
// Make the image
let img = await new DIG.Delete().getImage(avatar);
// Add the image as an attachement
let attach = new Discord.MessageAttachment(img, "delete.png");
message.channel.send({
files: [attach]
});
}
// Send the message with the image attached to an embed
if (message.content === "*blur") {
// Get the avatarUrl of the user
let avatar = message.author.displayAvatarURL({
dynamic: false,
format: 'png'
});
// Make the image
let img = await new DIG.Blur().getImage(avatar);
// Add the image as an attachement
let embed = new Discord.MessageEmbed()
.setTitle("Blur")
.setImage("attachment://delete.png");
let attach = new Discord.MessageAttachment(img, "blur.png");
message.channel.send({
embeds: [embed],
files: [attach]
});
}
});
// Log in to the bot
bot.login("super_secret_token");
`Discord.js v14
`js
// Import the required elements from the discord.js library.
const { Client, GatewayIntentBits, AttachmentBuilder, EmbedBuilder } = require("discord.js");
// Create a new discord.js client.
const bot = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
],
});const DIG = require("discord-image-generation");
// Listen to the ready event
bot.on("ready", () => {
console.log("Bot is online");
});
// Listen to the message event
bot.on("messageCreate", async (message) => {
// Send the image in a simple message
if (message.content === "*delete") {
// Get the avatarUrl of the user
let avatar = message.author.displayAvatarURL({
forceStatic: true,
extension: 'png'
});
// Make the image
let img = await new DIG.Delete().getImage(avatar);
// Add the image as an attachement
let attach = new AttachmentBuilder(img).setName("delete.png");
message.channel.send({
files: [attach]
});
}
// Send the message with the image attached to an embed
if (message.content === "*blur") {
// Get the avatarUrl of the user
let avatar = message.author.displayAvatarURL({
forceStatic: true,
extension: 'png'
});
// Make the image
let img = await new DIG.Blur().getImage(avatar);
// Add the image as an attachement
let embed = new EmbedBuilder()
.setTitle("Blur")
.setImage("attachment://blur.png");
let attach = new AttachmentBuilder(img).setName("blur.png");
message.channel.send({
embeds: [embed],
files: [attach]
});
}
});
// Log in to the bot
bot.login("super_secret_token");
`Available images
Filters
-
new DIG.Blur().getImage(, );!Blur
-
new DIG.Gay().getImage();!Gay
-
new DIG.Greyscale().getImage();-
new DIG.Invert().getImage();-
new DIG.Sepia().getImage();
Gifs
-
new DIG.Blink().getImage(delay (in ms), , .....);> You can add as many images as you want
-
new DIG.Triggered().getImage();
Montage
-
new DIG.Ad().getImage();!Ad
-
new DIG.Affect().getImage();-
new DIG.Batslap().getImage(, );-
new DIG.Beautiful().getImage();-
new DIG.Bed().getImage(, );!Bed
-
new DIG.Bobross().getImage();-
new DIG.Clown().getImage();-
new DIG.ConfusedStonk().getImage();
-
new DIG.Deepfry().getImage();-
new DIG.Delete().getImage();-
new DIG.DiscordBlack().getImage()-
new DIG.DiscordBlue().getImage()-
new DIG.DoubleStonk().getImage()-
new DIG.Facepalm().getImage();-
new DIG.Hearbreaking().getImage();-
new DIG.Hitler().getImage();-
new DIG.Jail().getImage();!Jail
-
new DIG.Karaba().getImage();-
new DIG.Kiss().getImage(, );!Kiss
-
new DIG.LisaPresentation().getImage();> Limited to 300char
-
new DIG.Mikkelsen().getImage();(Thanks to sιмση ℓεcℓεяε#5765)
-
new DIG.Mms().getImage();!MMS
-
new DIG.NotStonk().getImage();-
new DIG.Podium().getImage();-
new DIG.Poutine().getImage();-
new DIG.Rip().getImage();!RIP
-
new DIG.Snyder().getImage();-
new DIG.Spank().getImage(, );-
new DIG.Stonk().getImage();-
new DIG.Tatoo().getImage()-
new DIG.Thomas().getImage();-
new DIG.Trash().getImage();-
new DIG.Wanted().getImage(, );> Currency ($, €, ...)
Utils
-
new DIG.Circle().getImage();-
new DIG.Color().getImage();> An hex color is needed, like "#FF0000"
-
new DIG.Denoise().getImage(, );> Level should be a number
-
new DIG.Mirror().getImage(, );`
Thanks to Alex15#0010 for the big help ! ❤