summaryrefslogtreecommitdiff
path: root/server/src/commands/fun/Clapify.ts
blob: 3e6e0fd0cb51f147514674df8545f0798615241b (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
33
34
35
36
37
38
39
import { Command } from 'discord-akairo';
import { Message } from 'discord.js';

export default class ClapifyFun extends Command {
    public constructor() {
        super('clapify', {
            aliases: ['clapify'],
            category: 'fun',
            description: {
                content: 'Clapifies your specified text.',
                usage: '[text]',
                examples: [
                    'clap this lol'
                ]
            },
            ratelimit: 3,
            args: [
                {
                    id: 'text',
                    type: 'string',
                    prompt: {
                        start: 'What would you like to clapify?'
                    },
                    match: 'rest'
                },
                {
                    id: 'deleteinitialmessage',
                    flag: ['-delete', '-d'],
                    match: 'flag'
                }
            ]
        });
    }
    
    public exec(msg: Message, { text, deleteinitialmessage }): Promise<Message> {
        if (deleteinitialmessage) msg.delete();
        return msg.channel.send(text.split(' ').join('👏'));
    }
}