From 3156d1e03d50bbe3125ebb8071fb9174f2705fe3 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 28 Mar 2020 13:35:42 -0400 Subject: [PATCH] Fix error that would cause the entire 12 lines to be cut out --- commands/meme-gen/bart-chalkboard.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/meme-gen/bart-chalkboard.js b/commands/meme-gen/bart-chalkboard.js index 794ac279..9f73cee0 100644 --- a/commands/meme-gen/bart-chalkboard.js +++ b/commands/meme-gen/bart-chalkboard.js @@ -50,7 +50,10 @@ module.exports = class LisaPresentationCommand extends Command { ctx.textBaseline = 'top'; ctx.font = '19px Akbar'; ctx.fillStyle = 'white'; - ctx.fillText(shortenText(ctx, `${text.toUpperCase()}\n`.repeat(12).trim(), 500), 30, 27); + const shortened = shortenText(ctx, text.toUpperCase(), 500); + const arr = []; + for (let i = 0; i < 12; i++) arr.push(shortened); + ctx.fillText(arr.join('\n'), 30, 27); return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'bart-chalkboard.png' }] }); } };