// If there's a error, propagates it back to the caller.
let download = message.download_media(&path).await?;
// OR
if let Ok(to_download) = message.download_media(&path).await {
if to_download {
// Media was there to download
}
}
// OR
let download = message.download_media(&path).await;
if download.is_ok() && download.unwrap() {
// Media was there to download
}
I suppose that there is no need to change the description for client.download_media(). Users must implement error handling and not call .unwrap() directly.
Aims to fix #216 . Tested with code:
I suppose that there is no need to change the description for
client.download_media()
. Users must implement error handling and not call.unwrap()
directly.