Show long results properly
This commit is contained in:
parent
d06f3755f5
commit
6f9f1d069e
@ -113,7 +113,9 @@ pub fn wc_crop(command: &str, msg: &Message) -> Result<(), Error> {
|
|||||||
let client = reqwest::ClientBuilder::new().timeout(::std::time::Duration::from_secs(10000)).build().unwrap();
|
let client = reqwest::ClientBuilder::new().timeout(::std::time::Duration::from_secs(10000)).build().unwrap();
|
||||||
let new_url = client.get(&format!("https://wynncraft-autocrop.herokuapp.com/crop?url={}", url)).send()?.text().unwrap();
|
let new_url = client.get(&format!("https://wynncraft-autocrop.herokuapp.com/crop?url={}", url)).send()?.text().unwrap();
|
||||||
if new_url.starts_with("https://res.cloudinary.com") {
|
if new_url.starts_with("https://res.cloudinary.com") {
|
||||||
msg.channel_id.say(&new_url)?;
|
for chunk in new_url.split(' ').collect::<Vec<_>>().chunks(21) {
|
||||||
|
msg.channel_id.say(&chunk.join(" "))?;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
bail!(failure::err_msg("could not crop image"));
|
bail!(failure::err_msg("could not crop image"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user