No longer need to send link
This commit is contained in:
parent
6ad819f9a7
commit
70df93f344
1 changed files with 5 additions and 6 deletions
|
@ -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")
|
||||
}
|
||||
};
|
||||
}};
|
Loading…
Reference in a new issue