diff --git a/commands/edit-image/snapchat.js b/commands/edit-image/snapchat.js index 52e617de..02a2400f 100644 --- a/commands/edit-image/snapchat.js +++ b/commands/edit-image/snapchat.js @@ -1,7 +1,6 @@ const Command = require('../../structures/Command'); const { createCanvas, loadImage } = require('canvas'); const request = require('node-superfetch'); -const visualCenter = require('visual-center'); module.exports = class SnapchatCommand extends Command { constructor(client) { @@ -56,9 +55,7 @@ module.exports = class SnapchatCommand extends Command { ctx.textBaseline = 'top'; ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(base.height / 24); const barHeight = (base.height / 24) * 2; - const { visualTop } = await this.visualCenter(body); - const moveCenter = visualTop > 0.5 ? 1 - visualTop - 0.5 : visualTop < 0.5 ? 1 + (visualTop - 0.5) : 1; - const barPosition = base.height - (base.height * moveCenter); + const barPosition = base.height - (base.height / 3); ctx.globalAlpha = 0.3; ctx.fillStyle = 'black'; ctx.fillRect(0, barPosition - barHeight, base.width, barHeight); @@ -66,13 +63,4 @@ module.exports = class SnapchatCommand extends Command { ctx.fillText(text, base.width / 2, (barPosition - barHeight) * 0.4); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'snapchat.png' }] }); } - - visualCenter(image) { - return new Promise((res, rej) => { - visualCenter(image.toString('base64'), (err, data) => { - if (err) return rej(err); - return res(data); - }); - }); - } }; diff --git a/package.json b/package.json index 2577bb9a..bfc16437 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,6 @@ "tictactoe-minimax-ai": "^1.2.1", "user-agents": "^1.0.602", "valid-url": "^1.0.9", - "visual-center": "^0.1.1", "wavefile": "^11.0.0", "winston": "^3.3.3", "ytdl-core": "^4.5.0"