refactor(send): media_from reads the thumbnail off the item itself

All three callers passed item.thumbnail_url() as the fourth argument — a parameter that could never vary without defeating its own purpose, and only the video arm ever reads it. The function takes the item already; it asks the item. Three call sites lose an argument.
This commit is contained in:
2026-09-24 04:37:53 +08:00
parent e72cb1b98f
commit 0765b7deec
2 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -189,7 +189,7 @@ fn media_from_file(
path: std::path::PathBuf,
caption: Option<&str>,
) -> Result<InputMedia, String> {
media_from(item, InputFile::file(path), caption, item.thumbnail_url())
media_from(item, InputFile::file(path), caption)
}
/// Builds the media group item from a (smaller) URL.
@@ -198,7 +198,7 @@ fn media_from_url(
url: &str,
caption: Option<&str>,
) -> Result<InputMedia, String> {
media_from(item, input_file_for(url)?, caption, item.thumbnail_url())
media_from(item, input_file_for(url)?, caption)
}
/// One item prepared for the upload fallback: the ready-to-send media plus