forked from Fuseteam/xiaobot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwaifu.js
32 lines (30 loc) · 991 Bytes
/
waifu.js
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
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const request = require('node-superfetch');
const { shorten } = require('../../util/Util');
module.exports = class WaifuCommand extends Command {
constructor(client) {
super(client, {
name: 'waifu',
aliases: ['this-waifu-does-not-exist'],
group: 'random',
memberName: 'waifu',
description: 'Responds with a randomly generated waifu and backstory.',
clientPermissions: ['EMBED_LINKS'],
credit: [
{
name: 'This Waifu Does Not Exist',
url: 'https://www.thiswaifudoesnotexist.net/'
}
]
});
}
async run(msg) {
const num = Math.floor(Math.random() * 100000);
const { text } = await request.get(`https://www.thiswaifudoesnotexist.net/snippet-${num}.txt`);
const embed = new MessageEmbed()
.setDescription(shorten(text, 1000))
.setThumbnail(`https://www.thiswaifudoesnotexist.net/example-${num}.jpg`);
return msg.embed(embed);
}
};