mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-23 16:50:49 +00:00
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
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:
parent
c4fccbcc4c
commit
8fdd576eb9
1 changed files with 5 additions and 3 deletions
|
@ -135,12 +135,14 @@ pub fn dot_osu_hook<'a>(
|
|||
.collect::<Vec<_>>()
|
||||
.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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue