From 0a36fbe67b15dab2001d7b100bb709c511b7a3d3 Mon Sep 17 00:00:00 2001 From: bignutty <3515180-bignutty@users.noreply.gitlab.com> Date: Thu, 1 Aug 2024 19:39:53 +0200 Subject: [PATCH] add color picker card --- commands/interaction/slash/search/google.js | 10 ++++++++++ commands/message/search/google.js | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/commands/interaction/slash/search/google.js b/commands/interaction/slash/search/google.js index faf15b4..6911186 100644 --- a/commands/interaction/slash/search/google.js +++ b/commands/interaction/slash/search/google.js @@ -32,6 +32,7 @@ const SEARCH_CARD_TYPES = { UNIT_CONVERTER: 6, DICTIONARY: 7, FUNBOX_COIN_FLIP: 10, + FUNBOX_COLOR_PICKER: 11, } // TODO: create a favicon() util @@ -142,6 +143,15 @@ function createSearchResultPage(context, result, doodle){ footer: renderFooter(context, doodle) }) break; + case SEARCH_CARD_TYPES.FUNBOX_COLOR_PICKER: + res = createEmbed("default", context, { + description: `### ${result.card.title}\n${result.card.components.map((c)=>`${pill(c.label)} ${smallPill(c.content)}`).join('\n')}`, + thumbnail: { + url: result.card.thumbnail + }, + footer: renderFooter(context, doodle) + }) + break; default: res = createEmbed("error", context, "Unknown GoogleResult Type: " + result.type) break; diff --git a/commands/message/search/google.js b/commands/message/search/google.js index 5ae58c9..505b919 100644 --- a/commands/message/search/google.js +++ b/commands/message/search/google.js @@ -33,6 +33,7 @@ const SEARCH_CARD_TYPES = { UNIT_CONVERTER: 6, DICTIONARY: 7, FUNBOX_COIN_FLIP: 10, + FUNBOX_COLOR_PICKER: 11, } // TODO: create a favicon() util @@ -142,6 +143,15 @@ function createSearchResultPage(context, result, doodle){ footer: renderFooter(context, doodle) }) break; + case SEARCH_CARD_TYPES.FUNBOX_COLOR_PICKER: + res = createEmbed("default", context, { + description: `### ${result.card.title}\n${result.card.components.map((c)=>`${pill(c.label)} ${smallPill(c.content)}`).join('\n')}`, + thumbnail: { + url: result.card.thumbnail + }, + footer: renderFooter(context, doodle) + }) + break; default: res = createEmbed("error", context, "Unknown GoogleResult Type: " + result.type) break;