mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 22:23:03 -04:00
increase answer length
This commit is contained in:
parent
c1c63e3fc2
commit
94bee05892
1 changed files with 8 additions and 2 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue