From 8fdd576eb9831fb84f585ab384c89313b4c79af0 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Sun, 4 May 2025 02:15:10 +0200 Subject: [PATCH] Grab .olz for map hooks too --- youmubot-osu/src/discord/hook.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/youmubot-osu/src/discord/hook.rs b/youmubot-osu/src/discord/hook.rs index a8ad8d5..bde485f 100644 --- a/youmubot-osu/src/discord/hook.rs +++ b/youmubot-osu/src/discord/hook.rs @@ -135,12 +135,14 @@ pub fn dot_osu_hook<'a>( .collect::>() .await; + const ARCHIVE_EXTS: [&'static str; 2] = [".osz", ".olz"]; let osz_embeds = msg .attachments .iter() - .filter( - |a| a.filename.ends_with(".osz") && a.size < 20 * 1024 * 1024, /* 20mb */ - ) + .filter(|a| { + ARCHIVE_EXTS.iter().any(|ext| a.filename.ends_with(*ext)) + && a.size < 20 * 1024 * 1024 /* 20mb */ + }) .map(|attachment| { let url = attachment.url.clone(); async move {