Added Karaba() and bug fixes
This commit is contained in:
BIN
src/assets/karaba.png
Normal file
BIN
src/assets/karaba.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 186 KiB |
@@ -7,7 +7,7 @@ module.exports = class Blur {
|
||||
* @param {level} level
|
||||
*/
|
||||
async getImage(image, level) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
image = await jimp.read(image);
|
||||
image.blur(isNaN(level) ? 5 : parseInt(level));
|
||||
let raw;
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Gay {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
let bg = await Canvas.loadImage(`${__dirname}/../../assets/gay.png`);
|
||||
let img = await Canvas.loadImage(image);
|
||||
const canvas = Canvas.createCanvas(480, 480);
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Geryscale {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
image = await jimp.read(image);
|
||||
image.greyscale();
|
||||
let raw;
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Invert {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
image = await jimp.read(image);
|
||||
image.invert();
|
||||
let raw;
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Sepia {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
image = await jimp.read(image);
|
||||
image.sepia();
|
||||
let raw;
|
||||
|
@@ -9,7 +9,7 @@ module.exports = class Triggered {
|
||||
* @param {number} timeout
|
||||
*/
|
||||
async getImage(image, timeout = 15) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
if (isNaN(timeout)) throw new Error(`The timeout argument must be a number.`);
|
||||
const base = await Canvas.loadImage(`${__dirname}/../../assets/triggered.png`);
|
||||
const img = await Canvas.loadImage(image);
|
||||
|
@@ -3,10 +3,10 @@ const Canvas = require(`canvas`);
|
||||
module.exports = class Ad {
|
||||
/**
|
||||
* Ad
|
||||
* @param {image} image1
|
||||
* @param {image} image1
|
||||
*/
|
||||
async getImage(image1) {
|
||||
if (!image1) throw new Error(`You must provide an image as argument.`);
|
||||
if (!image1) throw new Error(`You must provide an image as an argument`);
|
||||
const canvas = Canvas.createCanvas(550, 474);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
image1 = await Canvas.loadImage(image1);
|
||||
@@ -15,4 +15,4 @@ module.exports = class Ad {
|
||||
ctx.drawImage(background, 0, 0, 550, 474);
|
||||
return canvas.toBuffer();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Affect {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
let base = await jimp.read(`${__dirname}/../../assets/affect.png`);
|
||||
let img = await jimp.read(image);
|
||||
img.resize(200, 157);
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Beautiful {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
let base = await jimp.read(`${__dirname}/../../assets/beautiful.png`);
|
||||
base.resize(376, 400);
|
||||
let img = await jimp.read(image);
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Bobross {
|
||||
* @param {image} image1
|
||||
*/
|
||||
async getImage(image1) {
|
||||
if (!image1) throw new Error(`You must provide an image as argument.`);
|
||||
if (!image1) throw new Error(`You must provide an image as an argument`);
|
||||
const base = await loadImage(`${__dirname}/../../assets/bobross.png`);
|
||||
const canvas = createCanvas(base.width, base.height);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
|
@@ -3,10 +3,10 @@ const Canvas = require(`canvas`);
|
||||
module.exports = class ConfusedStonk {
|
||||
/**
|
||||
* ConfusedStonk
|
||||
* @param {image} image1
|
||||
* @param {image} image1
|
||||
*/
|
||||
async getImage(image1) {
|
||||
if (!image1) throw new Error(`You must provide an image as argument.`);
|
||||
if (!image1) throw new Error(`You must provide an image as an argument`);
|
||||
const canvas = Canvas.createCanvas(1994, 1296);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
image1 = await Canvas.loadImage(image1);
|
||||
@@ -15,4 +15,4 @@ module.exports = class ConfusedStonk {
|
||||
ctx.drawImage(background, 0, 0, 1994, 1296);
|
||||
return canvas.toBuffer();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Delete {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
let bg = await jimp.read(`${__dirname}/../../assets/delete.png`);
|
||||
image = await jimp.read(image);
|
||||
image.resize(195, 195);
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class DiscordBlack {
|
||||
* @param {image} image1
|
||||
*/
|
||||
async getImage(image1) {
|
||||
if (!image1) throw new Error(`You must provide an image as argument.`);
|
||||
if (!image1) throw new Error(`You must provide an image as an argument`);
|
||||
const canvas = Canvas.createCanvas(610, 610);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
image1 = await Canvas.loadImage(image1);
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class DiscordBlue {
|
||||
* @param {image} image1
|
||||
*/
|
||||
async getImage(image1) {
|
||||
if (!image1) throw new Error(`You must provide an image as argument.`);
|
||||
if (!image1) throw new Error(`You must provide an image as an argument`);
|
||||
const canvas = Canvas.createCanvas(610, 610);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
image1 = await Canvas.loadImage(image1);
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Facepalm {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
let canvas = Canvas.createCanvas(632, 357);
|
||||
let ctx = canvas.getContext(`2d`);
|
||||
ctx.fillStyle = `black`;
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Hitler {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
let bg = await jimp.read(`${__dirname}/../../assets/hitler.png`);
|
||||
let img = await jimp.read(image);
|
||||
img.resize(140, 140);
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Jail {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
let bg = await Canvas.loadImage(`${__dirname}/../../assets/jail.png`);
|
||||
let img = await Canvas.loadImage(image);
|
||||
const canvas = Canvas.createCanvas(400, 400);
|
||||
|
18
src/module/montage/karaba.js
Normal file
18
src/module/montage/karaba.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const Canvas = require(`canvas`);
|
||||
|
||||
module.exports = class Mms {
|
||||
/**
|
||||
* MMS
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image as an argument`);
|
||||
let bg = await Canvas.loadImage(`${__dirname}/../../assets/karaba.png`);
|
||||
let img = await Canvas.loadImage(image);
|
||||
const canvas = Canvas.createCanvas(bg.width, bg.height);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
ctx.drawImage(img, 130, 44, 130, 130);
|
||||
ctx.drawImage(bg, 0, 0, bg.width, bg.height);
|
||||
return canvas.toBuffer();
|
||||
}
|
||||
};
|
@@ -6,7 +6,7 @@ module.exports = class Mms {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
let bg = await Canvas.loadImage(`${__dirname}/../../assets/mms.png`);
|
||||
let img = await Canvas.loadImage(image);
|
||||
const canvas = Canvas.createCanvas(400, 400);
|
||||
|
@@ -3,10 +3,10 @@ const Canvas = require(`canvas`);
|
||||
module.exports = class NotStonk {
|
||||
/**
|
||||
* NotStonk
|
||||
* @param {image} image1
|
||||
* @param {image} image1
|
||||
*/
|
||||
async getImage(image1) {
|
||||
if (!image1) throw new Error(`You must provide an image as argument.`);
|
||||
if (!image1) throw new Error(`You must provide an image as an argument`);
|
||||
const canvas = Canvas.createCanvas(960, 576);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
image1 = await Canvas.loadImage(image1);
|
||||
@@ -15,4 +15,4 @@ module.exports = class NotStonk {
|
||||
ctx.drawImage(background, 0, 0, 960, 576);
|
||||
return canvas.toBuffer();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@@ -3,10 +3,10 @@ const Canvas = require(`canvas`);
|
||||
module.exports = class Poutine {
|
||||
/**
|
||||
* Ad
|
||||
* @param {image} image1
|
||||
* @param {image} image1
|
||||
*/
|
||||
async getImage(image1) {
|
||||
if (!image1) throw new Error(`You must provide an image as argument.`);
|
||||
if (!image1) throw new Error(`You must provide an image as an argument`);
|
||||
const canvas = Canvas.createCanvas(600, 539);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
image1 = await Canvas.loadImage(image1);
|
||||
@@ -15,4 +15,4 @@ module.exports = class Poutine {
|
||||
ctx.drawImage(background, 0, 0, 600, 539);
|
||||
return canvas.toBuffer();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@@ -7,7 +7,7 @@ module.exports = class Rip {
|
||||
*/
|
||||
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
const canvas = Canvas.createCanvas(720, 405);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
const background = await Canvas.loadImage(`${__dirname}/../../assets/rip.png`);
|
||||
|
@@ -3,10 +3,10 @@ const Canvas = require(`canvas`);
|
||||
module.exports = class Stonk {
|
||||
/**
|
||||
* Stonk
|
||||
* @param {image} image1
|
||||
* @param {image} image1
|
||||
*/
|
||||
async getImage(image1) {
|
||||
if (!image1) throw new Error(`You must provide an image as argument.`);
|
||||
if (!image1) throw new Error(`You must provide an image as an argument`);
|
||||
const canvas = Canvas.createCanvas(900, 539);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
image1 = await Canvas.loadImage(image1);
|
||||
@@ -15,4 +15,4 @@ module.exports = class Stonk {
|
||||
ctx.drawImage(background, 0, 0, 900, 539);
|
||||
return canvas.toBuffer();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Tatoo {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an 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);
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Thomas {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
const canvas = Canvas.createCanvas(841, 1058);
|
||||
const ctx = canvas.getContext(`2d`);
|
||||
const avatar = await Canvas.loadImage(image);
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Trash {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
let bg = await jimp.read(`${__dirname}/../../assets/trash.png`);
|
||||
image = await jimp.read(image);
|
||||
image.resize(309, 309);
|
||||
|
@@ -9,7 +9,7 @@ module.exports = class Wanted {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image, currency = `$`) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
if (typeof currency != `string`) throw new Error(`You must provide a string for the currency.`);
|
||||
if (currency.length > 1) throw new Error(`You must provide only one character for the currency.`);
|
||||
var price = Math.floor(Math.random() * 188708) + 329889;
|
||||
|
@@ -6,7 +6,7 @@ module.exports = class Circle {
|
||||
* @param {image} image
|
||||
*/
|
||||
async getImage(image) {
|
||||
if (!image) throw new Error(`You must provide an image.`);
|
||||
if (!image) throw new Error(`You must provide an image as a first argument.`);
|
||||
image = await jimp.read(image);
|
||||
image.resize(480, 480);
|
||||
image.circle();
|
||||
|
Reference in New Issue
Block a user