diff --git a/commands/interaction/slash/search/google.js b/commands/interaction/slash/search/google.js index 83dc320..e7c7c7b 100644 --- a/commands/interaction/slash/search/google.js +++ b/commands/interaction/slash/search/google.js @@ -10,7 +10,7 @@ const { STATICS, STATIC_ICONS } = require('#utils/statics') const { ApplicationCommandOptionTypes } = require('detritus-client/lib/constants'); function renderFooter(context, doodle){ - if(doodle.label) return { + if(doodle.super_g) return { iconUrl: doodle.super_g, text: `${doodle.label} • Google` } @@ -78,14 +78,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, { diff --git a/commands/message/search/google.js b/commands/message/search/google.js index cbe12b2..4f83717 100644 --- a/commands/message/search/google.js +++ b/commands/message/search/google.js @@ -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, {