From 70df93f3441a6faa8f3b7bcb60531cf5db42eae6 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 12 Oct 2018 15:41:25 +0200 Subject: [PATCH] No longer need to send link --- commands/fun/face.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/commands/fun/face.js b/commands/fun/face.js index e043e3a8..910bf573 100644 --- a/commands/fun/face.js +++ b/commands/fun/face.js @@ -26,16 +26,15 @@ module.exports = class faceappCommand extends Command { } async run(message, { url, type }) { - if(url.includes("http") || url.includes("www")) { + + var Attachment = (message.attachments).array(); + let face = type.toLowerCase(); - let { body } = await superagent.get(url) + let { body } = await superagent.get(Attachment[0].url) let image = await faceapp.process(body, face) .catch(error => { message.say('Cant recognize the face') console.error(error) }) message.channel.sendFile(image) - } else - message.say("You need to input a link") - } -}; \ No newline at end of file +}}; \ No newline at end of file