Added confusedstonk
This commit is contained in:
BIN
src/assets/confusedStonk.png
Normal file
BIN
src/assets/confusedStonk.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 MiB |
18
src/module/montage/confusedStonk.js
Normal file
18
src/module/montage/confusedStonk.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const Canvas = require("canvas");
|
||||
|
||||
module.exports = class ConfusedStonk {
|
||||
/**
|
||||
* ConfusedStonk
|
||||
* @param {image} image1
|
||||
*/
|
||||
async getImage(image1) {
|
||||
if (!image1) throw new Error(`You must provide an image as argument.`);
|
||||
const canvas = Canvas.createCanvas(1994, 1296);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
image1 = await Canvas.loadImage(image1);
|
||||
const background = await Canvas.loadImage(`${__dirname}/../../assets/confusedStonk.png`);
|
||||
ctx.drawImage(image1, 230, 75, 400, 400);
|
||||
ctx.drawImage(background, 0, 0, 1994, 1296);
|
||||
return canvas.toBuffer();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user