From 94bee05892e5c7a48f545169d6e2e26021bc21d0 Mon Sep 17 00:00:00 2001 From: derpystuff <3515180-derpystuff@users.noreply.gitlab.com> Date: Wed, 11 Jan 2023 22:32:59 +0100 Subject: [PATCH] increase answer length --- commands/message/search/quora.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/commands/message/search/quora.js b/commands/message/search/quora.js index 388f45c..48b4470 100644 --- a/commands/message/search/quora.js +++ b/commands/message/search/quora.js @@ -4,7 +4,7 @@ const { editOrReply } = require('../../../labscore/utils/message') const { STATICS } = require('../../../labscore/utils/statics') const { paginator } = require('../../../labscore/client'); -const { bing, quora } = require('../../../labscore/api'); +const { quora } = require('../../../labscore/api'); function createQuoraAnswerPage(context, question, answer){ let tags = question.tags.map((t) => { @@ -15,7 +15,7 @@ function createQuoraAnswerPage(context, question, answer){ createEmbed("default", context, { title: question.title, url: answer.url, - description: `${tags.splice(0, 4).join(' ')}\n\n${answer.content.substr(0,1000)}`, + description: `${tags.splice(0, 4).join(' ')}\n\n${answer.content.substr(0,2000)}`, footer: { iconUrl: STATICS.quora, text: `Quora • ${context.application.name}` @@ -23,6 +23,12 @@ function createQuoraAnswerPage(context, question, answer){ }) ] } + + if(answer.content.length >= 2000){ + if(res.embeds[0].description.endsWith(' ')) res.embeds[0].description = res.embeds[0].description.substr(0,res.embeds[0].description.length - 1) + res.embeds[0].description += link(answer.url, '...', 'Click to read the entire answer.') + } + if(answer.author){ res.embeds[0].author = { name: answer.author.name.substr(0,1000),