From 10de83d196f05a89b639539dcede50dbee076b1f Mon Sep 17 00:00:00 2001 From: Evorp <3vorpgaming@gmail.com> Date: Sat, 7 Oct 2023 14:52:21 -0700 Subject: [PATCH] hotfix for /palette --- src/events/buttons/image/palette.ts | 1 - src/helpers/images/palette.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/events/buttons/image/palette.ts b/src/events/buttons/image/palette.ts index db9cf462b..476e4e955 100644 --- a/src/events/buttons/image/palette.ts +++ b/src/events/buttons/image/palette.ts @@ -13,7 +13,6 @@ export const button: Button = { const url = await getImageFromMessage(message); const [attachment, embed] = await paletteAttachment({ url: url, - name: url.split("/").at(-1), }); if (attachment == null) diff --git a/src/helpers/images/palette.ts b/src/helpers/images/palette.ts index 562d2bb51..1cc597d45 100644 --- a/src/helpers/images/palette.ts +++ b/src/helpers/images/palette.ts @@ -19,7 +19,7 @@ const GRADIENT_HEIGHT = 50; export interface options { url: string; - name: string; + name?: string; } export interface AllColors { @@ -171,7 +171,7 @@ export async function paletteAttachment( const attachment = new MessageAttachment( colorCanvas.toBuffer("image/png"), - `${options.name ? options.name : "palette.png"}`, + `${options.name || "palette.png"}`, ); return [attachment, embed];