summaryrefslogtreecommitdiff
path: root/src/commands/anime/waifu.ts
blob: 80363e3be76ed9a36cea3453d8b0ba7195d2ba45 (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, CommandoMessage } from 'discord.js-commando';
import request from 'node-superfetch';
import { MessageEmbed } from 'discord.js';
import { shorten } from '../../utils/Util.js'

module.exports = class WaifuAnime extends Command {
    constructor(client) {
        super(client, {
            name: 'waifu',
            aliases: ['thiswaifudoesnotexist', 'this-waifu-does-not-exist'],
            group: 'anime',
            memberName: 'waifu',
            description: 'Replies with a randomly generated waifu and a backstory. WARNING: don\'t get too attatched.',
            examples: [
                
            ],
            userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
            clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
            throttling: {
                usages: 5,
                duration: 30
            },
        });
    }
    async run(msg: CommandoMessage) {
        const num = Math.floor(Math.random() * 100000)
        const { text } = await request.get(`https://www.thiswaifudoesnotexist.net/snippet-${num}.txt`)
        let emb = new MessageEmbed()
            .setDescription(shorten(text, 1000))
            .setColor(0xFFCC4D)
            .setThumbnail(`https://www.thiswaifudoesnotexist.net/example-${num}.jpg`)
        msg.reply(emb)
    }
};