Fixed invalid paths
@@ -186,6 +186,10 @@ bot.login("super_secret_token")
|
|||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.1.2
|
||||||
|
- Fixed invalid path
|
||||||
|
- Moved assets folder
|
||||||
|
|
||||||
## v1.0.0
|
## v1.0.0
|
||||||
- Changed the full structure
|
- Changed the full structure
|
||||||
- Sorted all files in folders
|
- Sorted all files in folders
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "discord-image-generation",
|
"name": "discord-image-generation",
|
||||||
"version": "1.0.8",
|
"version": "1.1.2",
|
||||||
"description": "discord-image-generation is a powerfull module that allow you to generate awesome images.",
|
"description": "discord-image-generation is a powerfull module that allow you to generate awesome images.",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 581 KiB After Width: | Height: | Size: 581 KiB |
Before Width: | Height: | Size: 342 KiB After Width: | Height: | Size: 342 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 324 KiB After Width: | Height: | Size: 324 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 188 KiB After Width: | Height: | Size: 188 KiB |
Before Width: | Height: | Size: 623 KiB After Width: | Height: | Size: 623 KiB |
Before Width: | Height: | Size: 675 KiB After Width: | Height: | Size: 675 KiB |
Before Width: | Height: | Size: 468 KiB After Width: | Height: | Size: 468 KiB |
Before Width: | Height: | Size: 743 KiB After Width: | Height: | Size: 743 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 119 KiB |
@@ -7,7 +7,7 @@ module.exports = class Gay {
|
|||||||
*/
|
*/
|
||||||
async getImage(image) {
|
async getImage(image) {
|
||||||
if (!image) throw new Error(`You must provide an image.`);
|
if (!image) throw new Error(`You must provide an image.`);
|
||||||
let bg = await Canvas.loadImage(`../src/module/assets/gay.png`);
|
let bg = await Canvas.loadImage(`../src/assets/gay.png`);
|
||||||
let img = await Canvas.loadImage(image);
|
let img = await Canvas.loadImage(image);
|
||||||
const canvas = Canvas.createCanvas(480, 480);
|
const canvas = Canvas.createCanvas(480, 480);
|
||||||
const ctx = canvas.getContext(`2d`);
|
const ctx = canvas.getContext(`2d`);
|
||||||
|
@@ -11,7 +11,7 @@ module.exports = class Triggered {
|
|||||||
async getImage(image, timeout = 15) {
|
async getImage(image, timeout = 15) {
|
||||||
if (!image) throw new Error(`You must provide an image.`);
|
if (!image) throw new Error(`You must provide an image.`);
|
||||||
if (isNaN(timeout)) throw new Error(`The timeout argument must be a number.`)
|
if (isNaN(timeout)) throw new Error(`The timeout argument must be a number.`)
|
||||||
const base = await Canvas.loadImage(`../src/module/assets/triggered.png`);
|
const base = await Canvas.loadImage(`../src/assets/triggered.png`);
|
||||||
const img = await Canvas.loadImage(image);
|
const img = await Canvas.loadImage(image);
|
||||||
const GIF = new GIFEncoder(256, 310)
|
const GIF = new GIFEncoder(256, 310)
|
||||||
GIF.start();
|
GIF.start();
|
||||||
|
@@ -7,7 +7,7 @@ module.exports = class Affect {
|
|||||||
*/
|
*/
|
||||||
async getImage(image) {
|
async getImage(image) {
|
||||||
if (!image) throw new Error("You must provide an image.");
|
if (!image) throw new Error("You must provide an image.");
|
||||||
let base = await jimp.read(`../src/module/assets/affect.png`);
|
let base = await jimp.read(`../src/assets/affect.png`);
|
||||||
let img = await jimp.read(image);
|
let img = await jimp.read(image);
|
||||||
img.resize(200, 157);
|
img.resize(200, 157);
|
||||||
base.composite(img, 180, 383);
|
base.composite(img, 180, 383);
|
||||||
|
@@ -9,7 +9,7 @@ module.exports = class Batslap {
|
|||||||
async getImage(image1, image2) {
|
async getImage(image1, image2) {
|
||||||
if (!image1) throw new Error("You must provide an image as a first argument.");
|
if (!image1) throw new Error("You must provide an image as a first argument.");
|
||||||
if (!image2) throw new Error("You must provide an image as a second argument.");
|
if (!image2) throw new Error("You must provide an image as a second argument.");
|
||||||
let base = await jimp.read(`../src/module/assets/batslap.png`);
|
let base = await jimp.read(`../src/assets/batslap.png`);
|
||||||
image1 = await jimp.read(image1);
|
image1 = await jimp.read(image1);
|
||||||
image2 = await jimp.read(image2);
|
image2 = await jimp.read(image2);
|
||||||
image1.circle();
|
image1.circle();
|
||||||
|
@@ -7,7 +7,7 @@ module.exports = class Beautiful {
|
|||||||
*/
|
*/
|
||||||
async getImage(image) {
|
async getImage(image) {
|
||||||
if (!image) throw new Error("You must provide an image.");
|
if (!image) throw new Error("You must provide an image.");
|
||||||
let base = await jimp.read(`../src/module/assets/beautiful.png`);
|
let base = await jimp.read(`../src/assets/beautiful.png`);
|
||||||
base.resize(376, 400);
|
base.resize(376, 400);
|
||||||
let img = await jimp.read(image);
|
let img = await jimp.read(image);
|
||||||
img.resize(84, 95);
|
img.resize(84, 95);
|
||||||
|
@@ -9,7 +9,7 @@ module.exports = class Bed {
|
|||||||
async getImage(image1, image2) {
|
async getImage(image1, image2) {
|
||||||
if (!image1) throw new Error(`You must provide an image as a first argument.`);
|
if (!image1) throw new Error(`You must provide an image as a first argument.`);
|
||||||
if (!image2) throw new Error(`You must provide an image as a second argument.`);
|
if (!image2) throw new Error(`You must provide an image as a second argument.`);
|
||||||
let bg = await jimp.read(`../src/module/assets/bed.png`);
|
let bg = await jimp.read(`../src/assets/bed.png`);
|
||||||
image1 = await jimp.read(image1);
|
image1 = await jimp.read(image1);
|
||||||
image2 = await jimp.read(image2);
|
image2 = await jimp.read(image2);
|
||||||
image1.circle();
|
image1.circle();
|
||||||
|
@@ -7,7 +7,7 @@ module.exports = class Delete {
|
|||||||
*/
|
*/
|
||||||
async getImage(image) {
|
async getImage(image) {
|
||||||
if (!image) throw new Error(`You must provide an image.`);
|
if (!image) throw new Error(`You must provide an image.`);
|
||||||
let bg = await jimp.read(`../src/module/assets/delete.png`);
|
let bg = await jimp.read(`../src/assets/delete.png`);
|
||||||
image = await jimp.read(image);
|
image = await jimp.read(image);
|
||||||
image.resize(195, 195);
|
image.resize(195, 195);
|
||||||
bg.composite(image, 120, 135);
|
bg.composite(image, 120, 135);
|
||||||
|
@@ -13,7 +13,7 @@ module.exports = class Facepalm {
|
|||||||
ctx.fillRect(0, 0, 632, 357);
|
ctx.fillRect(0, 0, 632, 357);
|
||||||
let avatar = await Canvas.loadImage(image);
|
let avatar = await Canvas.loadImage(image);
|
||||||
ctx.drawImage(avatar, 199, 112, 235, 235);
|
ctx.drawImage(avatar, 199, 112, 235, 235);
|
||||||
let layer = await Canvas.loadImage(`../src/module/assets/facepalm.png`);
|
let layer = await Canvas.loadImage(`../src/assets/facepalm.png`);
|
||||||
ctx.drawImage(layer, 0, 0, 632, 357);
|
ctx.drawImage(layer, 0, 0, 632, 357);
|
||||||
return canvas.toBuffer();
|
return canvas.toBuffer();
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@ module.exports = class Hitler {
|
|||||||
*/
|
*/
|
||||||
async getImage(image) {
|
async getImage(image) {
|
||||||
if (!image) throw new Error(`You must provide an image.`);
|
if (!image) throw new Error(`You must provide an image.`);
|
||||||
let bg = await jimp.read(`../src/module/assets/hitler.png`);
|
let bg = await jimp.read(`../src/assets/hitler.png`);
|
||||||
let img = await jimp.read(image);
|
let img = await jimp.read(image);
|
||||||
img.resize(140, 140);
|
img.resize(140, 140);
|
||||||
bg.composite(img, 46, 43);
|
bg.composite(img, 46, 43);
|
||||||
|
@@ -7,7 +7,7 @@ module.exports = class Jail {
|
|||||||
*/
|
*/
|
||||||
async getImage(image) {
|
async getImage(image) {
|
||||||
if (!image) throw new Error(`You must provide an image.`);
|
if (!image) throw new Error(`You must provide an image.`);
|
||||||
let bg = await Canvas.loadImage(`../src/module/assets/jail.png`);
|
let bg = await Canvas.loadImage(`../src/assets/jail.png`);
|
||||||
let img = await Canvas.loadImage(image);
|
let img = await Canvas.loadImage(image);
|
||||||
const canvas = Canvas.createCanvas(400, 400);
|
const canvas = Canvas.createCanvas(400, 400);
|
||||||
const ctx = canvas.getContext(`2d`);
|
const ctx = canvas.getContext(`2d`);
|
||||||
|
@@ -9,7 +9,7 @@ module.exports = class Kiss {
|
|||||||
async getImage(image1, image2) {
|
async getImage(image1, image2) {
|
||||||
if (!image1) throw new Error(`You must provide an image as a first argument.`);
|
if (!image1) throw new Error(`You must provide an image as a first argument.`);
|
||||||
if (!image2) throw new Error(`You must provide an image as a second argument.`);
|
if (!image2) throw new Error(`You must provide an image as a second argument.`);
|
||||||
let base = await jimp.read(`../src/module/assets/kiss.png`);
|
let base = await jimp.read(`../src/assets/kiss.png`);
|
||||||
image1 = await jimp.read(image1);
|
image1 = await jimp.read(image1);
|
||||||
image2 = await jimp.read(image2);
|
image2 = await jimp.read(image2);
|
||||||
image1.circle();
|
image1.circle();
|
||||||
|
@@ -7,7 +7,7 @@ module.exports = class Mms {
|
|||||||
*/
|
*/
|
||||||
async getImage(image) {
|
async getImage(image) {
|
||||||
if (!image) throw new Error(`You must provide an image.`);
|
if (!image) throw new Error(`You must provide an image.`);
|
||||||
let bg = await Canvas.loadImage(`../src/module/assets/mms.png`);
|
let bg = await Canvas.loadImage(`../src/assets/mms.png`);
|
||||||
let img = await Canvas.loadImage(image);
|
let img = await Canvas.loadImage(image);
|
||||||
const canvas = Canvas.createCanvas(400, 400);
|
const canvas = Canvas.createCanvas(400, 400);
|
||||||
const ctx = canvas.getContext(`2d`);
|
const ctx = canvas.getContext(`2d`);
|
||||||
|
@@ -11,7 +11,7 @@ module.exports = class Rip {
|
|||||||
if (!image) throw new Error(`You must provide an image.`);
|
if (!image) throw new Error(`You must provide an image.`);
|
||||||
const canvas = Canvas.createCanvas(244, 253);
|
const canvas = Canvas.createCanvas(244, 253);
|
||||||
const ctx = canvas.getContext(`2d`);
|
const ctx = canvas.getContext(`2d`);
|
||||||
const background = await Canvas.loadImage(`../src/module/assets/rip.png`);
|
const background = await Canvas.loadImage(`../src/assets/rip.png`);
|
||||||
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
|
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
|
||||||
const avatar = await Canvas.loadImage(image);
|
const avatar = await Canvas.loadImage(image);
|
||||||
ctx.drawImage(avatar, 63, 110, 90, 90);
|
ctx.drawImage(avatar, 63, 110, 90, 90);
|
||||||
|
@@ -9,7 +9,7 @@ module.exports = class Spank {
|
|||||||
async getImage(image1, image2) {
|
async getImage(image1, image2) {
|
||||||
if (!image1) throw new Error(`You must provide an image as a first argument.`);
|
if (!image1) throw new Error(`You must provide an image as a first argument.`);
|
||||||
if (!image2) throw new Error(`You must provide an image as a second argument.`);
|
if (!image2) throw new Error(`You must provide an image as a second argument.`);
|
||||||
let bg = await jimp.read(`../src/module/assets/spank.png`);
|
let bg = await jimp.read(`../src/assets/spank.png`);
|
||||||
image1 = await jimp.read(image1);
|
image1 = await jimp.read(image1);
|
||||||
image2 = await jimp.read(image2);
|
image2 = await jimp.read(image2);
|
||||||
image1.circle();
|
image1.circle();
|
||||||
|
@@ -10,7 +10,7 @@ module.exports = class Tatoo {
|
|||||||
const canvas = Canvas.createCanvas(750, 1089);
|
const canvas = Canvas.createCanvas(750, 1089);
|
||||||
const ctx = canvas.getContext(`2d`);
|
const ctx = canvas.getContext(`2d`);
|
||||||
const avatar = await Canvas.loadImage(image);
|
const avatar = await Canvas.loadImage(image);
|
||||||
const background = await Canvas.loadImage(`../src/module/assets/tatoo.png`);
|
const background = await Canvas.loadImage(`../src/assets/tatoo.png`);
|
||||||
ctx.drawImage(avatar, 145, 575, 400, 400);
|
ctx.drawImage(avatar, 145, 575, 400, 400);
|
||||||
ctx.drawImage(background, 0, 0, 750, 1089);
|
ctx.drawImage(background, 0, 0, 750, 1089);
|
||||||
return canvas.toBuffer();
|
return canvas.toBuffer();
|
||||||
|
@@ -10,7 +10,7 @@ module.exports = class Thomas {
|
|||||||
const canvas = Canvas.createCanvas(841, 1058);
|
const canvas = Canvas.createCanvas(841, 1058);
|
||||||
const ctx = canvas.getContext(`2d`);
|
const ctx = canvas.getContext(`2d`);
|
||||||
const avatar = await Canvas.loadImage(image);
|
const avatar = await Canvas.loadImage(image);
|
||||||
const background = await Canvas.loadImage(`../src/module/assets/thomas.png`);
|
const background = await Canvas.loadImage(`../src/assets/thomas.png`);
|
||||||
ctx.drawImage(avatar, 220, 190, 400, 400);
|
ctx.drawImage(avatar, 220, 190, 400, 400);
|
||||||
ctx.drawImage(background, 0, 0, 841, 1058);
|
ctx.drawImage(background, 0, 0, 841, 1058);
|
||||||
return canvas.toBuffer();
|
return canvas.toBuffer();
|
||||||
|
@@ -7,7 +7,7 @@ module.exports = class Trash {
|
|||||||
*/
|
*/
|
||||||
async getImage(image) {
|
async getImage(image) {
|
||||||
if (!image) throw new Error(`You must provide an image.`);
|
if (!image) throw new Error(`You must provide an image.`);
|
||||||
let bg = await jimp.read(`../src/module/assets/trash.png`);
|
let bg = await jimp.read(`../src/assets/trash.png`);
|
||||||
image = await jimp.read(image);
|
image = await jimp.read(image);
|
||||||
image.resize(309, 309);
|
image.resize(309, 309);
|
||||||
image.blur(5);
|
image.blur(5);
|
||||||
|
@@ -16,7 +16,7 @@ module.exports = class Wanted {
|
|||||||
const canvas = Canvas.createCanvas(257, 383);
|
const canvas = Canvas.createCanvas(257, 383);
|
||||||
const ctx = canvas.getContext(`2d`);
|
const ctx = canvas.getContext(`2d`);
|
||||||
const avatar = await Canvas.loadImage(image);
|
const avatar = await Canvas.loadImage(image);
|
||||||
const background = await Canvas.loadImage(`../src/module/assets/wanted.png`);
|
const background = await Canvas.loadImage(`../src/assets/wanted.png`);
|
||||||
ctx.drawImage(avatar, 25, 60, 210, 210);
|
ctx.drawImage(avatar, 25, 60, 210, 210);
|
||||||
ctx.drawImage(background, 0, 0, 257, 383);
|
ctx.drawImage(background, 0, 0, 257, 383);
|
||||||
ctx.font = applyText(canvas, price.toLocaleString() + currency, 40, 200, "Times New Roman");
|
ctx.font = applyText(canvas, price.toLocaleString() + currency, 40, 200, "Times New Roman");
|
||||||
|