From e43775ed7da84572980a7fda7137b187d132263b Mon Sep 17 00:00:00 2001 From: bignutty <3515180-bignutty@users.noreply.gitlab.com> Date: Fri, 3 Jan 2025 00:41:04 +0100 Subject: [PATCH] migrate manual color conversions to helper --- commands/interaction/slash/search/maps.js | 4 ++-- commands/message/search/maps.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/interaction/slash/search/maps.js b/commands/interaction/slash/search/maps.js index 0a68cda..b597999 100644 --- a/commands/interaction/slash/search/maps.js +++ b/commands/interaction/slash/search/maps.js @@ -1,7 +1,7 @@ const { maps, mapsSupplemental } = require('#api'); const { PERMISSION_GROUPS } = require('#constants'); -const { createEmbed } = require('#utils/embed'); +const { createEmbed, hexToEmbedColor } = require('#utils/embed'); const { acknowledge } = require('#utils/interactions'); const { link, icon, iconAsEmojiObject, citation } = require('#utils/markdown'); const { editOrReply } = require('#utils/message') @@ -19,7 +19,7 @@ function renderPlaceCard(context, place) { }, description: `${place.address.full}`, url: place.url, - color: parseInt(place.style.color.substring(1, 7), 16) + color: hexToEmbedColor(place.style.color) })] if (place.display_type) { diff --git a/commands/message/search/maps.js b/commands/message/search/maps.js index b7cec14..abfe797 100644 --- a/commands/message/search/maps.js +++ b/commands/message/search/maps.js @@ -1,7 +1,7 @@ const { maps, mapsSupplemental } = require('#api'); const { PERMISSION_GROUPS } = require('#constants'); -const { createEmbed } = require('#utils/embed'); +const { createEmbed, hexToEmbedColor } = require('#utils/embed'); const { acknowledge } = require('#utils/interactions'); const { link, icon, iconAsEmojiObject, citation } = require('#utils/markdown'); const { editOrReply } = require('#utils/message') @@ -18,7 +18,7 @@ function renderPlaceCard(context, place) { }, description: `${place.address.full}`, url: place.url, - color: parseInt(place.style.color.substring(1, 7), 16) + color: hexToEmbedColor(place.style.color) })] if (place.display_type) {