mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-12 16:13:05 -04:00
render tags on r34
This commit is contained in:
parent
1e880ded55
commit
ba4aea067b
1 changed files with 13 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
const { createEmbed, formatPaginationEmbeds } = require('../../../labscore/utils/embed')
|
const { createEmbed, formatPaginationEmbeds } = require('../../../labscore/utils/embed')
|
||||||
const { highlight } = require('../../../labscore/utils/markdown')
|
const { pill } = require('../../../labscore/utils/markdown')
|
||||||
const { editOrReply } = require('../../../labscore/utils/message')
|
const { editOrReply } = require('../../../labscore/utils/message')
|
||||||
|
|
||||||
const { paginator } = require('../../../labscore/client');
|
const { paginator } = require('../../../labscore/client');
|
||||||
|
@ -9,14 +9,24 @@ function createRule34Page(context, result){
|
||||||
let res = {
|
let res = {
|
||||||
"embeds": [
|
"embeds": [
|
||||||
createEmbed("default", context, {
|
createEmbed("default", context, {
|
||||||
description: `Rating: ${highlight(result.rating)}`,
|
|
||||||
image: {
|
image: {
|
||||||
url: result.fileUrl
|
url: result.fileUrl
|
||||||
|
},
|
||||||
|
footer: {
|
||||||
|
text: `Rating: ${result.rating}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
if(result.thumbnail) res.embeds[0].thumbnail = { url: result.thumbnail };
|
|
||||||
|
// Render a few tags
|
||||||
|
if(result.tags) {
|
||||||
|
let tags = result.tags.splice(0, 5)
|
||||||
|
let tagDisplay = ''
|
||||||
|
for(const t of tags) tagDisplay += pill(t)
|
||||||
|
res.embeds[0].description += `\n${tagDisplay}`
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue