import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import request from 'node-superfetch'; import { MessageEmbed } from 'discord.js'; //@ts-ignore yes it does tf import { shorten } from '../../utils/Util.js' module.exports = class WaifuAnime extends Command { constructor(client: CommandoClient) { 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`) return msg.reply(emb) } };