summaryrefslogtreecommitdiff
path: root/src/commands/fun/howify.ts
blob: e7e7eb6ca682f6c05971c64ecd3d59d7a109b55c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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())
        }
        
    }
};