summaryrefslogtreecommitdiff
path: root/src/commands/fun/yomomma.ts
blob: c0b174332d332820905f2e56b79918f6a16d8f58 (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 axios from 'axios'
import { MessageEmbed } from 'discord.js';
import emoji from 'emoji-random'

module.exports = class YoMommaFun extends Command {
    constructor(client) {
        super(client, {
            name: 'yomomma',
            aliases: ['yo-momma', 'yomama', 'mum', 'mam', 'mom'],
            group: 'fun',
            memberName: 'yomomma',
            description: 'Gives you a yo momma joke.',
            examples: ['uwu!yomomma'],
            throttling: {
                usages: 5,
                duration: 30
            },
            userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
            clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
        });
    }
    async run(msg: CommandoMessage) {
        try {
            let text = await (await axios.get('http://api.yomomma.info/')).data.joke
            msg.reply(`${text}` + ' ' + emoji.random())
        } catch (err) {
            console.log(err)
            msg.reply('Woops, there was an error with the (https://yomomma.info/) API. ' + emoji.random())
        }
    }
};