Grab .olz for map hooks too
Some checks failed
Build and Test / Format check (push) Has been cancelled
Build and Test / Lint (push) Has been cancelled
Build and Test / Test (push) Has been cancelled
Build and Test / Check dependency hash (push) Has been cancelled
Build and Test / Build (push) Has been cancelled

This commit is contained in:
Natsu Kagami 2025-05-04 02:15:10 +02:00
parent c4fccbcc4c
commit 8fdd576eb9
Signed by: nki
GPG key ID: 55A032EB38B49ADB

View file

@ -135,12 +135,14 @@ pub fn dot_osu_hook<'a>(
.collect::<Vec<_>>() .collect::<Vec<_>>()
.await; .await;
const ARCHIVE_EXTS: [&'static str; 2] = [".osz", ".olz"];
let osz_embeds = msg let osz_embeds = msg
.attachments .attachments
.iter() .iter()
.filter( .filter(|a| {
|a| a.filename.ends_with(".osz") && a.size < 20 * 1024 * 1024, /* 20mb */ ARCHIVE_EXTS.iter().any(|ext| a.filename.ends_with(*ext))
) && a.size < 20 * 1024 * 1024 /* 20mb */
})
.map(|attachment| { .map(|attachment| {
let url = attachment.url.clone(); let url = attachment.url.clone();
async move { async move {