Y5DIB6C3UMYHI7UVDP442GJCLRCIUHZRHJDQVP3IQSUNJFXG4ZOAC
let page = fetch_cat_page();
if let Err(e) = page {
let _ = msg.reply(
&ctx,
format!(
"Catto express: was not able to deliver you cat: {}\n{}",
e,
"https://i.redd.it/4q32jedhkgi31.jpg" // crying catto
),
);
return Ok(());
}
let url = fetch_url_in_cat_page(page?);
if url.is_none() {
let _ = msg.reply(
&ctx,
format!("Catto express: your catto got lost in the page :pensive:"),
);
return Ok(());
}
let url = url.unwrap();
let _ = msg
.channel_id
.send_files(&ctx, vec![url.as_str()], |m| m.content(&msg.author));
Ok(())
}
fn fetch_cat_page() -> Result<String, Box<dyn std::error::Error>> {