Fix timeout issue

This commit is contained in:
Sakuhl 2018-01-28 15:56:01 +01:00
parent 1a84202d2b
commit d06f3755f5

View File

@ -110,7 +110,8 @@ Visit the Discord for more help: https://discord.gg/GbN7HeG"))?;
pub fn wc_crop(command: &str, msg: &Message) -> Result<(), Error> {
let url = &command[5..];
let new_url = reqwest::get(&format!("https://wynncraft-autocrop.herokuapp.com/crop?url={}", url))?.text().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();
if new_url.starts_with("https://res.cloudinary.com") {
msg.channel_id.say(&new_url)?;
} else {