Send .webp images as photo instead of document
Previously .webp files fell into the default match arm and were sent
via sendDocument, which Telegram renders as sticker-like preview.
Now .webp joins .jpg/.jpeg/.png in the sendPhoto branch; Telegram
converts them to JPG server-side.
commit9bfb4ebbe51a5e7752d9758e7889ba286a8ce6ae
authoriko <mail@iko.soy>
dateWed 13 May 2026, 08:11 (5 months ago)
parent87846ad
src/media.rs+1−1
@@ -17,7 +17,7 @@ pub async fn send_one(bot: &Bot, chat: ChatId, path: &Path) {
1717 .to_ascii_lowercase();
1818
1919 let result = match ext.as_str() {
20− "jpg" | "jpeg" | "png" => bot
20+ "jpg" | "jpeg" | "png" | "webp" => bot
2121 .send_photo(chat, InputFile::file(path))
2222 .await
2323 .map(|_| ()),