From 648cb17f8029e87267ff8d292eac50708aa3cc29 Mon Sep 17 00:00:00 2001 From: Kian Kasad Date: Sun, 16 Mar 2025 14:55:51 -0700 Subject: [PATCH] Filter out non-image attachments from Hack Night images thread --- src/utils/hack-night.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/hack-night.ts b/src/utils/hack-night.ts index e70a24f..580db4f 100644 --- a/src/utils/hack-night.ts +++ b/src/utils/hack-night.ts @@ -179,8 +179,9 @@ ${topContributors } // TODO(@rayhanadev): upload all these images to the Sanity project - // TODO(@rayhanadev): filter out files that are not images - const images = [...attachments.map((a) => a.url)]; + const images = attachments + .filter((a) => a.contentType && (a.contentType.startsWith('image/') || a.contentType.startsWith('video/'))) + .map((a) => a.url); await starterMessage.unpin(); await hackNightImageThread.setLocked(true);