Added .tatoo(), updated jsdoc

This commit is contained in:
2020-06-11 10:08:30 +02:00
parent d78cafd91a
commit c4010ff4ce
4 changed files with 23 additions and 4 deletions

View File

@@ -26,6 +26,10 @@ You can also join me on my <a href="https://discord.gg/qvzwqaM">discord server.<
- You can now configure a currency - You can now configure a currency
- Added .thomas() - Added .thomas()
## v0.1.11
- Added .tatoo()
- Updated JSDoc
# Download # Download

View File

@@ -1,6 +1,6 @@
{ {
"name": "discord-image-generation", "name": "discord-image-generation",
"version": "0.1.10", "version": "0.1.11",
"description": "discord-image-generation is a powerfull module that allow you to generate awesome images.", "description": "discord-image-generation is a powerfull module that allow you to generate awesome images.",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {

View File

@@ -49,7 +49,7 @@ class DIG {
} }
/** /**
* * Gay
* @param {image} image * @param {image} image
*/ */
static async gay(image) { static async gay(image) {
@@ -393,7 +393,7 @@ class DIG {
} }
/** /**
* * Jail
* @param {image} image * @param {image} image
*/ */
static async jail(image) { static async jail(image) {
@@ -408,7 +408,7 @@ class DIG {
} }
/** /**
* * MMS
* @param {image} image * @param {image} image
*/ */
static async mms(image) { static async mms(image) {
@@ -436,6 +436,21 @@ class DIG {
ctx.drawImage(background, 0, 0, 841, 1058); ctx.drawImage(background, 0, 0, 841, 1058);
return canvas.toBuffer(); return canvas.toBuffer();
} }
/**
* Thomas
* @param {image} image
*/
static async tatoo(image) {
if (!image) throw new Error("You must provide an image as a first argument.");
const canvas = Canvas.createCanvas(750, 1089);
const ctx = canvas.getContext("2d");
const avatar = await Canvas.loadImage(image);
const background = await Canvas.loadImage(__dirname +"/assets/tatoo.png");
ctx.drawImage(avatar, 145, 575, 400, 400);
ctx.drawImage(background, 0, 0, 750, 1089);
return canvas.toBuffer();
}
} }
module.exports = DIG; module.exports = DIG;

BIN
src/module/assets/tatoo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 KiB