diff --git a/src/spoiler_mangas/mod.rs b/src/spoiler_mangas/mod.rs index 57cd8dc..9e60fc4 100644 --- a/src/spoiler_mangas/mod.rs +++ b/src/spoiler_mangas/mod.rs @@ -95,7 +95,12 @@ pub async fn check_image(msg: Message, bot: Bot) -> anyhow::Result<()> { bot.delete_message(msg.chat.id, msg.id).await?; let response = match id { Some(i) => bot.send_photo(msg.chat.id, teloxide::types::InputFile::file_id(i.0)).has_spoiler(true), - None => return Ok(()), + None => { + match msg.photo().unwrap().iter().max_by_key(|p| p.width) { + Some(f) => bot.send_photo(msg.chat.id, teloxide::types::InputFile::file_id(f.file.id.clone())).has_spoiler(true), + None => return Ok(()), + } + }, }; append_text(response, msg).await?; }