mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-12 08:03:09 -04:00
better description
This commit is contained in:
parent
5b40e96f8f
commit
c17c257bce
1 changed files with 7 additions and 7 deletions
|
@ -22,12 +22,6 @@ function createRedditPage(context, result){
|
||||||
name: result.subreddit.name,
|
name: result.subreddit.name,
|
||||||
url: result.subreddit.link
|
url: result.subreddit.link
|
||||||
},
|
},
|
||||||
description: `**${link(result.post.link, result.post.title)}**`,
|
|
||||||
fields: [{
|
|
||||||
name: "",
|
|
||||||
value: `${icon("upvote")}${highlight(result.post.score)} ${icon("person")} ${link(result.author.link, `u/${result.author.name}`)}`,
|
|
||||||
inline: true
|
|
||||||
}],
|
|
||||||
footer: {
|
footer: {
|
||||||
iconUrl: STATICS.reddit,
|
iconUrl: STATICS.reddit,
|
||||||
text: `Reddit • ${context.application.name}`
|
text: `Reddit • ${context.application.name}`
|
||||||
|
@ -38,14 +32,20 @@ function createRedditPage(context, result){
|
||||||
|
|
||||||
if(result.post.image) res.embeds[0].image = { url: result.post.image };
|
if(result.post.image) res.embeds[0].image = { url: result.post.image };
|
||||||
|
|
||||||
|
let description = [`**${link(result.post.link, result.post.title)}**`]
|
||||||
|
|
||||||
let awardData = []
|
let awardData = []
|
||||||
// Awards
|
// Awards
|
||||||
for(const a of Object.keys(result.awards)){
|
for(const a of Object.keys(result.awards)){
|
||||||
awardData.push(`${icon(`reddit_${a}`)}${highlight(result.awards[a])}`)
|
awardData.push(`${icon(`reddit_${a}`)}${highlight(result.awards[a])}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(awardData.length >= 1) res.embeds[0].description = res.embeds[0].description + `\n${awardData.join(' ')}`
|
if(awardData.length >= 1) description.push(`${awardData.join(' ')}`)
|
||||||
|
|
||||||
|
description.push(``)
|
||||||
|
description.push(`${icon("upvote")}${highlight(result.post.score)} ${icon("person")} ${link(result.author.link, `u/${result.author.name}`)}`)
|
||||||
|
|
||||||
|
res.embeds[0].description = description.join('\n')
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue