summaryrefslogtreecommitdiff
path: root/server/src/commands/fun/Opinion.ts
blob: 012af7e41f7795b7b62b7d4c21ebff3890e685bd (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
import { Command } from 'discord-akairo';
import { Message } from 'discord.js';

export default class OpinionFun extends Command {
    public constructor() {
        super('opinion', {
            aliases: ['opinion'],
            category: 'fun',
            description: {
                content: 'Determines the bot\'s opinion on something. WARNING: do not take these seriously.',
                usage: '[question]',
                examples: [
                    'avocadoes'
                ]
            },
            ratelimit: 3,
            args: [
                {
                    id: 'question',
                    type: 'string',
                    prompt: {
                        start: 'What would you like to get an opinion on?'
                    },
                    match: 'rest'
                }
            ]
        });
    }
    
    public exec(msg: Message, { question }): Promise<Message> {
        const opinions = ['👍', '👎'];
        return msg.reply(`*${question}* ${opinions[Math.floor(Math.random() * opinions.length)]}`);
    }
}