diff --git a/README.md b/README.md index 8b366cc..ac9e178 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,10 @@ bot.login("super_secret_token") ![Delete](https://imgur.com/6V1IYJp.png) +- ``new DIG.DoubleStonk().getImage(``)`` + +![DoubleStonk](https://imgur.com/HbuuUC6.png) + - ``new DIG.Facepalm().getImage(``);`` ![Facepalm](https://imgur.com/cdPC3P1.png) diff --git a/src/assets/doubleStonk.png b/src/assets/doubleStonk.png index 05389ed..4dc0afe 100644 Binary files a/src/assets/doubleStonk.png and b/src/assets/doubleStonk.png differ diff --git a/src/module/montage/doubleStonk.js b/src/module/montage/doubleStonk.js new file mode 100644 index 0000000..6d49541 --- /dev/null +++ b/src/module/montage/doubleStonk.js @@ -0,0 +1,28 @@ +const jimp = require("jimp"); + +module.exports = class DoubleStonk { + /** + * DoubleStonk + * @param {image} image1 + * @param {image} image2 + */ + 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(`${__dirname}/../../assets/doubleStonk.png`); + image1 = await jimp.read(image1); + image2 = await jimp.read(image2); + image1.circle(); + image2.circle(); + base.resize(577, 431); + image1.resize(140, 140); + image2.resize(140, 140); + base.composite(image2, 60, 20); + base.composite(image1, 0, 30); + let raw; + base.getBuffer("image/png", (err, buffer) => { + raw = buffer; + }); + return raw; + } +} \ No newline at end of file