Added NotStonk

This commit is contained in:
Killian
2020-07-16 23:07:21 +02:00
parent 97732334d8
commit dabb80e66e
2 changed files with 22 additions and 0 deletions

View File

@@ -160,6 +160,10 @@ bot.login("super_secret_token")
![MMS](https://imgur.com/nH3URHb.png)
- ``new DIG.NotStonk().getImage(`<Avatar>`);``
![NotStonk](https://imgur.com/NJ2Svtj.png)
- ``new DIG.Podium().getImage(`<Avatar1>, <Avatar2>, <Avatar2>, <Name1>, <Name2>, <Name3>`);``
![Podium](https://imgur.com/bQoKf0a.png)

View File

@@ -0,0 +1,18 @@
const Canvas = require("canvas");
module.exports = class NotStonk {
/**
* NotStonk
* @param {image} image1
*/
async getImage(image1) {
if (!image1) throw new Error(`You must provide an image as argument.`);
const canvas = Canvas.createCanvas(960, 576);
const ctx = canvas.getContext(`2d`);
image1 = await Canvas.loadImage(image1);
const background = await Canvas.loadImage(`${__dirname}/../../assets/notStonk.png`);
ctx.drawImage(image1, 140, 5, 190, 190);
ctx.drawImage(background, 0, 0, 960, 576);
return canvas.toBuffer();
}
}