From 61d800048ca05fd38d72801731fd5944d6bad544 Mon Sep 17 00:00:00 2001 From: Ashley Graves Date: Sun, 20 Oct 2024 16:26:35 +0200 Subject: [PATCH] better quote --- src/commands/fun/quote.js | 2 -- src/utils/quoter.js | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/fun/quote.js b/src/commands/fun/quote.js index a7a97c8..81d79b5 100644 --- a/src/commands/fun/quote.js +++ b/src/commands/fun/quote.js @@ -22,10 +22,8 @@ module.exports = { const msg = interaction.targetMessage; const user = msg.author; const avatar = `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=1024`; - console.log("Generating quote image"); try { const data = await createQuoteImage(avatar, user.displayName, msg.content, true, interaction.client.users.cache); - console.log("Sending quote image"); await interaction.followUp({ files: [{ diff --git a/src/utils/quoter.js b/src/utils/quoter.js index 5156c50..a41e499 100644 --- a/src/utils/quoter.js +++ b/src/utils/quoter.js @@ -29,6 +29,8 @@ function wrapText(context, text, x, y, maxWidth, lineHeight, preparingSentence, lines.push(preparingSentence.join(" ")); + y -= (lines.length * lineHeight) / 2; + lines.forEach(element => { const lineWidth = context.measureText(element).width; const xOffset = (maxWidth - lineWidth) / 2;