mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-10 07:03:08 -04:00
fix doodle issue
This commit is contained in:
parent
48939503f7
commit
2161289223
2 changed files with 14 additions and 9 deletions
|
@ -8,10 +8,9 @@ const { STATICS, STATIC_ICONS } = require('#utils/statics')
|
|||
|
||||
// TODO: Turn this into a general purpose permissions constant
|
||||
const { Permissions } = require("detritus-client/lib/constants");
|
||||
const { description } = require('../../interaction/slash/search/google');
|
||||
|
||||
function renderFooter(context, doodle){
|
||||
if(doodle.label) return {
|
||||
if(doodle?.super_g) return {
|
||||
iconUrl: doodle.super_g,
|
||||
text: `${doodle.label} • Google Search`
|
||||
}
|
||||
|
@ -80,14 +79,17 @@ function createSearchResultPage(context, result, doodle){
|
|||
case SEARCH_CARD_TYPES.DOODLE:
|
||||
res = createEmbed("default", context, {
|
||||
description: `### ${result.card.title}\n${result.card.description}\n\n${link(result.card.learn_more, `Learn More ${icon("link_open_external")}`, "Learn more about this Doodle")}`,
|
||||
thumbnail: {
|
||||
url: result.card.images.thumbnail
|
||||
},
|
||||
image: {
|
||||
url: result.card.images.image
|
||||
},
|
||||
footer: renderFooter(context, doodle)
|
||||
})
|
||||
|
||||
if(result.card.images.thumbnail){
|
||||
res.thumbnail = {
|
||||
url: result.card.images.thumbnail
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SEARCH_CARD_TYPES.ENTITY:
|
||||
res = createEmbed("default", context, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue