mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-10 07:03:08 -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,
|
||||
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: {
|
||||
iconUrl: STATICS.reddit,
|
||||
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 };
|
||||
|
||||
let description = [`**${link(result.post.link, result.post.title)}**`]
|
||||
|
||||
let awardData = []
|
||||
// Awards
|
||||
for(const a of Object.keys(result.awards)){
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue