From 234d9efd3a1cc507f29df065e50701f26c4e19f6 Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Mon, 5 Nov 2018 20:50:14 +0100 Subject: [PATCH] --- commands/fun/face.js | 52 -------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 commands/fun/face.js diff --git a/commands/fun/face.js b/commands/fun/face.js deleted file mode 100644 index 9c01d4c..0000000 --- a/commands/fun/face.js +++ /dev/null @@ -1,52 +0,0 @@ -const { Command } = require('discord.js-commando'); -const faceapp = require('faceapp') -const superagent = require('superagent') -const blacklist = require('../../json/blacklist.json') - -module.exports = class faceappCommand extends Command { - constructor(client) { - super(client, { - name: 'face', - group: 'fun', - memberName: 'face', - description: `use faceapp to change the face of someone, Here the available filter `, - args: [ - { - key: 'type', - prompt: 'How the face should change ? (default to female)', - type: 'string', - default: 'female', - oneOf: ["no-filter", "smile", "smile_2", "hot", "old", "young", "hollywood", "fun_glasses", "hitman", "mustache_free", "pan", "heisenberg", "female", "female_2", "male", "impression", "goatee", "mustache", "hipster", "lion", "bangs", "glasses", "wave", "makeup"] - }, - { - key: 'url', - prompt: 'Wich image would you want to process (default to empty so you can also send an image without the adress)', - type: 'string', - default: '' - } - ] - }); - } - - async run(message, { url, type }) { - if(blacklist[message.author.id]) - return message.channel.send("You are blacklisted") - - let Attachment = (message.attachments).array(); - let origin = null; - if(!Attachment[0] && !url) { - return message.say("You need to send an image") - } else if(url.includes("http") || url.includes("www")) { - origin = url; - } else - origin = Attachment[0].url - - let face = type.toLowerCase(); - let { body } = await superagent.get(origin) - let image = await faceapp.process(body, face) - .catch(error => { - message.say('Cant recognize the face') - console.error(error) - }) - return message.channel.send({files: [image]}); -}}; \ No newline at end of file