import { Command, CommandoMessage } from 'discord.js-commando'; import how from 'howifier'; import emoji from 'emoji-random'; module.exports = class HowifyFun extends Command { constructor(client) { super(client, { name: 'howify', aliases: ['how'], group: 'fun', memberName: 'howify', description: 'Howifies any image you send.', userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'EMBED_LINKS'], clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'EMBED_LINKS'], examples: ['uwu!howify', 'uwu!how'] }); } run(msg: CommandoMessage) { if (msg.attachments.size) { // fs.unlinkSync('../../../node_modules/howifier/images/blissgay.jpeg') msg.attachments.forEach(async attachment => { var u1 = await how(attachment.url); setTimeout(() => { msg.say({ files: [u1] }) }, 2000); }); } else { msg.reply('No image detected. ' + emoji.random()) } } };