From 34527088ab547e4bdf9cec8b969060ac77dad68b Mon Sep 17 00:00:00 2001 From: Sakuhl <2012collector@gmail.com> Date: Sun, 25 Feb 2018 10:04:28 +0100 Subject: [PATCH] Crop more images --- src/commands/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/mod.rs b/src/commands/mod.rs index bf69626..f2d701e 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -161,7 +161,9 @@ pub fn wc_crop(command: &str, msg: &Message) -> Result<(), Error> { pub fn wc_crop_discord_upload(msg: &Message) -> Result<(), Error> { let last = &msg.channel_id.messages(|g| g.before(msg.id).limit(1))?[0]; - for attachment in &last.attachments { + let mut attachments = last.attachments.clone(); + attachments.extend(msg.attachments.clone()); + for attachment in &attachments { let url = &attachment.url; let new_url = reqwest::get(&format!("https://wynncraft-autocrop.herokuapp.com/crop?url={}", url))?.text().unwrap(); if new_url.starts_with("https://res.cloudinary.com") {