summaryrefslogtreecommitdiff
path: root/src/commands/animals/cow.ts
blob: 3c84f0930ed121008cd036adc04a4f197a1449a4 (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
import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
//@ts-ignore no types
import cows from 'cows';

module.exports = class CowAnimals extends Command {
    constructor(client: CommandoClient) {
        super(client, {
            name: 'cow',
            aliases: ['cows'],
            group: 'animals',
            memberName: 'cow',
            description: 'Gives you a random cow.',
            throttling: {
                usages: 5,
                duration: 30
            },
            examples: ['uwu!cow', 'uwu!cows'],
            userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
            clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
        });
    }
    run(msg: CommandoMessage) {
        let cowNumber = Math.round((Math.random() * cows().length))
        let cow = cows()[cowNumber]
        return msg.reply(`\`\`\`${cow}\`\`\``);
    }
};