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