Crop more images

This commit is contained in:
Sakuhl 2018-02-25 10:04:28 +01:00
parent db1185494f
commit 34527088ab

View File

@ -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") {