Added stonk

This commit is contained in:
Killian
2020-07-16 22:57:26 +02:00
parent f242c448a0
commit 97732334d8
5 changed files with 22 additions and 0 deletions

View File

@@ -176,6 +176,10 @@ bot.login("super_secret_token")
![Spank](https://imgur.com/VRvogo7.png)
- ``new DIG.Stonk().getImage(`<Avatar>`);``
![Stonk](https://imgur.com/oAVgevR.png)
- ``new DIG.Tatoo().getImage(`<Avatar>`)``
![Tatoo](https://imgur.com/wJju4UJ.png)

BIN
src/assets/doubleStonk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 KiB

BIN
src/assets/notStonk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 KiB

BIN
src/assets/stonk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 KiB

View File

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