You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Killian' Dal-Cin d09d5ec6dc | 4 years ago | |
---|---|---|
.github/workflows | 5 years ago | |
src | 4 years ago | |
.gitignore | 5 years ago | |
README.md | 4 years ago | |
package.json | 4 years ago |
README.md
discord-image-generation
A powerfull module that allow you to generate awesome images.
Bugs and glitches
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
You can also join me on my discord server.
Download
You can download it from npmjs.
npm i discord-image-generation
Configuration
The first step is to import the module in your code.
const DIG = require("discord-image-generation");
Then you have to request your image and send it as an attachement.
// 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");
> You can also destructure to avoid repeating DIG.
// Listen to the ready event
bot.on("ready", () => {
console.log("ok");
})
// Listen to the message event
bot.on("message", async (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(attach)
}
})
// Log in to the bot
bot.login("super_secret_token")
Available images
Filters
new DIG.Blur().getImage(`<Avatar>`, `<Level(Number)>`);
new DIG.Gay().getImage(`<Avatar>`);
new DIG.Greyscale().getImage(`<Avatar>`);
new DIG.Invert().getImage(`<Avatar>`);
new DIG.Sepia().getImage(`<Avatar>`);
Gifs
new DIG.Blink().getImage(`<Avatar>`, `<Avatar2>`, <Timeout (Number in ms)>)
new DIG.Triggered().getImage(`<Avatar>`);
Montage
new DIG.Affect().getImage(`<Avatar>`);
new DIG.Batslap().getImage(`<Avatar>`, `<Avatar2>`);
new DIG.Beautiful().getImage(`<Avatar>`);
new DIG.Bed().getImage(`<Avatar>`, `<Avatar2>`);
new DIG.Delete().getImage(`<Avatar>`);
new DIG.Facepalm().getImage(`<Avatar>`);
new DIG.Hitler().getImage(`<Avatar>`);
new DIG.Jail().getImage(`<Avatar>`);
new DIG.Kiss().getImage(`<Avatar>`, `<Avatar2>`);
new DIG.Mms().getImage(`<Avatar>`);
new DIG.LisaPresentation().getImage(`<Text>`);
(Thanks to sιмση ℓεcℓεяε#5765)
Limited to 300char
new DIG.Rip().getImage(`<Avatar>`);
new DIG.Spank().getImage(`<Avatar>`, `<Avatar2>`);
new DIG.Tatoo().getImage(`<Avatar>`)
new DIG.Thomas().getImage(`<Avatar>`);
new DIG.Trash().getImage(`<Avatar>`);
new DIG.Wanted().getImage(`<Avatar>`, `<Currency>`);
Currency ($, €, ...)
Utils
new DIG.Circle().getImage(`<Avatar>`);
new DIG.Color().getImage(`<Color>`);
An hex color is needed, like "#FF0000"
Changelog
v1.1.5
- Added LisaPresentation
v1.1.2
- Fixed invalid path
- Moved assets folder
v1.0.0
- Changed the full structure
- Sorted all files in folders
- Sorted all files in the README
- Fixed new Wanted() text bug
- Added new Blink()
- Added a timeout options for new Triggered()
- Fixed the triggered example not animated
- Added some keywords
- Bumped jimp from ^0.12.1 to ^0.13.0
- Added workflow to auto publish to npm and github packages on push
v0.1.14
- Updated .thomas() example
v0.1.13
- Added example for .tatoo()
- Fixed the litle hole at the top of the users pic on .thomas()
v0.1.12
- Saved all examples to imgur
v0.1.11
- Added .tatoo()
- Updated JSDoc
v0.1.9
- Added options for the wanted.
- The base image has been updated
- There is now a random price diplayed
- You can now configure a currency
- Added .thomas()