From 492ad845fab1294c4f736fad0637671b0f084a71 Mon Sep 17 00:00:00 2001 From: Killian Date: Tue, 16 Jun 2020 10:47:54 +0200 Subject: [PATCH] Fixed invalid paths --- README.md | 4 ++++ package.json | 2 +- src/{module => }/assets/affect.png | Bin src/{module => }/assets/batslap.png | Bin src/{module => }/assets/beautiful.png | Bin src/{module => }/assets/bed.png | Bin src/{module => }/assets/delete.png | Bin src/{module => }/assets/facepalm.png | Bin src/{module => }/assets/gay.png | Bin src/{module => }/assets/hitler.png | Bin src/{module => }/assets/jail.png | Bin src/{module => }/assets/kiss.png | Bin src/{module => }/assets/mms.png | Bin src/{module => }/assets/rip.png | Bin src/{module => }/assets/spank.png | Bin src/{module => }/assets/tatoo.png | Bin src/{module => }/assets/thomas.png | Bin src/{module => }/assets/trash.png | Bin src/{module => }/assets/triggered.png | Bin src/{module => }/assets/wanted.png | Bin src/module/filters/gay.js | 2 +- src/module/gif/triggered.js | 2 +- src/module/montage/affect.js | 2 +- src/module/montage/batslap.js | 2 +- src/module/montage/beautiful.js | 2 +- src/module/montage/bed.js | 2 +- src/module/montage/delete.js | 2 +- src/module/montage/facepalm.js | 2 +- src/module/montage/hitler.js | 2 +- src/module/montage/jail.js | 2 +- src/module/montage/kiss.js | 2 +- src/module/montage/mms.js | 2 +- src/module/montage/rip.js | 2 +- src/module/montage/spank.js | 2 +- src/module/montage/tatoo.js | 2 +- src/module/montage/thomas.js | 2 +- src/module/montage/trash.js | 2 +- src/module/montage/wanted.js | 2 +- 38 files changed, 23 insertions(+), 19 deletions(-) rename src/{module => }/assets/affect.png (100%) rename src/{module => }/assets/batslap.png (100%) rename src/{module => }/assets/beautiful.png (100%) rename src/{module => }/assets/bed.png (100%) rename src/{module => }/assets/delete.png (100%) rename src/{module => }/assets/facepalm.png (100%) rename src/{module => }/assets/gay.png (100%) rename src/{module => }/assets/hitler.png (100%) rename src/{module => }/assets/jail.png (100%) rename src/{module => }/assets/kiss.png (100%) rename src/{module => }/assets/mms.png (100%) rename src/{module => }/assets/rip.png (100%) rename src/{module => }/assets/spank.png (100%) rename src/{module => }/assets/tatoo.png (100%) rename src/{module => }/assets/thomas.png (100%) rename src/{module => }/assets/trash.png (100%) rename src/{module => }/assets/triggered.png (100%) rename src/{module => }/assets/wanted.png (100%) diff --git a/README.md b/README.md index efb692a..ad3c558 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,10 @@ bot.login("super_secret_token") # Changelog +## v1.1.2 +- Fixed invalid path +- Moved assets folder + ## v1.0.0 - Changed the full structure - Sorted all files in folders diff --git a/package.json b/package.json index ca50286..f9660ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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.", "main": "src/index.js", "scripts": { diff --git a/src/module/assets/affect.png b/src/assets/affect.png similarity index 100% rename from src/module/assets/affect.png rename to src/assets/affect.png diff --git a/src/module/assets/batslap.png b/src/assets/batslap.png similarity index 100% rename from src/module/assets/batslap.png rename to src/assets/batslap.png diff --git a/src/module/assets/beautiful.png b/src/assets/beautiful.png similarity index 100% rename from src/module/assets/beautiful.png rename to src/assets/beautiful.png diff --git a/src/module/assets/bed.png b/src/assets/bed.png similarity index 100% rename from src/module/assets/bed.png rename to src/assets/bed.png diff --git a/src/module/assets/delete.png b/src/assets/delete.png similarity index 100% rename from src/module/assets/delete.png rename to src/assets/delete.png diff --git a/src/module/assets/facepalm.png b/src/assets/facepalm.png similarity index 100% rename from src/module/assets/facepalm.png rename to src/assets/facepalm.png diff --git a/src/module/assets/gay.png b/src/assets/gay.png similarity index 100% rename from src/module/assets/gay.png rename to src/assets/gay.png diff --git a/src/module/assets/hitler.png b/src/assets/hitler.png similarity index 100% rename from src/module/assets/hitler.png rename to src/assets/hitler.png diff --git a/src/module/assets/jail.png b/src/assets/jail.png similarity index 100% rename from src/module/assets/jail.png rename to src/assets/jail.png diff --git a/src/module/assets/kiss.png b/src/assets/kiss.png similarity index 100% rename from src/module/assets/kiss.png rename to src/assets/kiss.png diff --git a/src/module/assets/mms.png b/src/assets/mms.png similarity index 100% rename from src/module/assets/mms.png rename to src/assets/mms.png diff --git a/src/module/assets/rip.png b/src/assets/rip.png similarity index 100% rename from src/module/assets/rip.png rename to src/assets/rip.png diff --git a/src/module/assets/spank.png b/src/assets/spank.png similarity index 100% rename from src/module/assets/spank.png rename to src/assets/spank.png diff --git a/src/module/assets/tatoo.png b/src/assets/tatoo.png similarity index 100% rename from src/module/assets/tatoo.png rename to src/assets/tatoo.png diff --git a/src/module/assets/thomas.png b/src/assets/thomas.png similarity index 100% rename from src/module/assets/thomas.png rename to src/assets/thomas.png diff --git a/src/module/assets/trash.png b/src/assets/trash.png similarity index 100% rename from src/module/assets/trash.png rename to src/assets/trash.png diff --git a/src/module/assets/triggered.png b/src/assets/triggered.png similarity index 100% rename from src/module/assets/triggered.png rename to src/assets/triggered.png diff --git a/src/module/assets/wanted.png b/src/assets/wanted.png similarity index 100% rename from src/module/assets/wanted.png rename to src/assets/wanted.png diff --git a/src/module/filters/gay.js b/src/module/filters/gay.js index 66c8ad1..04dde5b 100644 --- a/src/module/filters/gay.js +++ b/src/module/filters/gay.js @@ -7,7 +7,7 @@ module.exports = class Gay { */ async getImage(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); const canvas = Canvas.createCanvas(480, 480); const ctx = canvas.getContext(`2d`); diff --git a/src/module/gif/triggered.js b/src/module/gif/triggered.js index 1a6bcb2..361469f 100644 --- a/src/module/gif/triggered.js +++ b/src/module/gif/triggered.js @@ -11,7 +11,7 @@ module.exports = class Triggered { async getImage(image, timeout = 15) { if (!image) throw new Error(`You must provide an image.`); 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 GIF = new GIFEncoder(256, 310) GIF.start(); diff --git a/src/module/montage/affect.js b/src/module/montage/affect.js index 436ff15..5804486 100644 --- a/src/module/montage/affect.js +++ b/src/module/montage/affect.js @@ -7,7 +7,7 @@ module.exports = class Affect { */ async getImage(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); img.resize(200, 157); base.composite(img, 180, 383); diff --git a/src/module/montage/batslap.js b/src/module/montage/batslap.js index 946682c..b15e8db 100644 --- a/src/module/montage/batslap.js +++ b/src/module/montage/batslap.js @@ -9,7 +9,7 @@ module.exports = class Batslap { async getImage(image1, image2) { 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."); - let base = await jimp.read(`../src/module/assets/batslap.png`); + let base = await jimp.read(`../src/assets/batslap.png`); image1 = await jimp.read(image1); image2 = await jimp.read(image2); image1.circle(); diff --git a/src/module/montage/beautiful.js b/src/module/montage/beautiful.js index 6b5355f..1c26a05 100644 --- a/src/module/montage/beautiful.js +++ b/src/module/montage/beautiful.js @@ -7,7 +7,7 @@ module.exports = class Beautiful { */ async getImage(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); let img = await jimp.read(image); img.resize(84, 95); diff --git a/src/module/montage/bed.js b/src/module/montage/bed.js index a16186b..cf40d97 100644 --- a/src/module/montage/bed.js +++ b/src/module/montage/bed.js @@ -9,7 +9,7 @@ module.exports = class Bed { async getImage(image1, image2) { 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.`); - let bg = await jimp.read(`../src/module/assets/bed.png`); + let bg = await jimp.read(`../src/assets/bed.png`); image1 = await jimp.read(image1); image2 = await jimp.read(image2); image1.circle(); diff --git a/src/module/montage/delete.js b/src/module/montage/delete.js index fb4fdc4..55330ee 100644 --- a/src/module/montage/delete.js +++ b/src/module/montage/delete.js @@ -7,7 +7,7 @@ module.exports = class Delete { */ async getImage(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.resize(195, 195); bg.composite(image, 120, 135); diff --git a/src/module/montage/facepalm.js b/src/module/montage/facepalm.js index 93bb6fc..d4fd22c 100644 --- a/src/module/montage/facepalm.js +++ b/src/module/montage/facepalm.js @@ -13,7 +13,7 @@ module.exports = class Facepalm { ctx.fillRect(0, 0, 632, 357); let avatar = await Canvas.loadImage(image); 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); return canvas.toBuffer(); } diff --git a/src/module/montage/hitler.js b/src/module/montage/hitler.js index 1e4f901..18454d6 100644 --- a/src/module/montage/hitler.js +++ b/src/module/montage/hitler.js @@ -7,7 +7,7 @@ module.exports = class Hitler { */ async getImage(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); img.resize(140, 140); bg.composite(img, 46, 43); diff --git a/src/module/montage/jail.js b/src/module/montage/jail.js index 541f047..5250557 100644 --- a/src/module/montage/jail.js +++ b/src/module/montage/jail.js @@ -7,7 +7,7 @@ module.exports = class Jail { */ async getImage(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); const canvas = Canvas.createCanvas(400, 400); const ctx = canvas.getContext(`2d`); diff --git a/src/module/montage/kiss.js b/src/module/montage/kiss.js index c86e729..2de5154 100644 --- a/src/module/montage/kiss.js +++ b/src/module/montage/kiss.js @@ -9,7 +9,7 @@ module.exports = class Kiss { async getImage(image1, image2) { 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.`); - let base = await jimp.read(`../src/module/assets/kiss.png`); + let base = await jimp.read(`../src/assets/kiss.png`); image1 = await jimp.read(image1); image2 = await jimp.read(image2); image1.circle(); diff --git a/src/module/montage/mms.js b/src/module/montage/mms.js index 55c0eae..0f8e95c 100644 --- a/src/module/montage/mms.js +++ b/src/module/montage/mms.js @@ -7,7 +7,7 @@ module.exports = class Mms { */ async getImage(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); const canvas = Canvas.createCanvas(400, 400); const ctx = canvas.getContext(`2d`); diff --git a/src/module/montage/rip.js b/src/module/montage/rip.js index c6c281b..75861ca 100644 --- a/src/module/montage/rip.js +++ b/src/module/montage/rip.js @@ -11,7 +11,7 @@ module.exports = class Rip { if (!image) throw new Error(`You must provide an image.`); const canvas = Canvas.createCanvas(244, 253); 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); const avatar = await Canvas.loadImage(image); ctx.drawImage(avatar, 63, 110, 90, 90); diff --git a/src/module/montage/spank.js b/src/module/montage/spank.js index 676233d..e5f769c 100644 --- a/src/module/montage/spank.js +++ b/src/module/montage/spank.js @@ -9,7 +9,7 @@ module.exports = class Spank { async getImage(image1, image2) { 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.`); - let bg = await jimp.read(`../src/module/assets/spank.png`); + let bg = await jimp.read(`../src/assets/spank.png`); image1 = await jimp.read(image1); image2 = await jimp.read(image2); image1.circle(); diff --git a/src/module/montage/tatoo.js b/src/module/montage/tatoo.js index 426e2c3..268fa5a 100644 --- a/src/module/montage/tatoo.js +++ b/src/module/montage/tatoo.js @@ -10,7 +10,7 @@ module.exports = class Tatoo { const canvas = Canvas.createCanvas(750, 1089); const ctx = canvas.getContext(`2d`); 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(background, 0, 0, 750, 1089); return canvas.toBuffer(); diff --git a/src/module/montage/thomas.js b/src/module/montage/thomas.js index a50f75e..55d47b0 100644 --- a/src/module/montage/thomas.js +++ b/src/module/montage/thomas.js @@ -10,7 +10,7 @@ module.exports = class Thomas { const canvas = Canvas.createCanvas(841, 1058); const ctx = canvas.getContext(`2d`); 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(background, 0, 0, 841, 1058); return canvas.toBuffer(); diff --git a/src/module/montage/trash.js b/src/module/montage/trash.js index c410fd0..d8e369f 100644 --- a/src/module/montage/trash.js +++ b/src/module/montage/trash.js @@ -7,7 +7,7 @@ module.exports = class Trash { */ async getImage(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.resize(309, 309); image.blur(5); diff --git a/src/module/montage/wanted.js b/src/module/montage/wanted.js index 9f17ca7..5e28c29 100644 --- a/src/module/montage/wanted.js +++ b/src/module/montage/wanted.js @@ -16,7 +16,7 @@ module.exports = class Wanted { const canvas = Canvas.createCanvas(257, 383); const ctx = canvas.getContext(`2d`); 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(background, 0, 0, 257, 383); ctx.font = applyText(canvas, price.toLocaleString() + currency, 40, 200, "Times New Roman");