mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
31 lines
743 B
JavaScript
31 lines
743 B
JavaScript
const Command = require('../../framework/Command');
|
|
const request = require('node-superfetch');
|
|
const cheerio = require('cheerio');
|
|
|
|
module.exports = class FmlCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'fml',
|
|
aliases: ['fuck-my-life', 'f-my-life'],
|
|
group: 'random-res',
|
|
memberName: 'fml',
|
|
description: 'Responds with a FML quote.',
|
|
nsfw: true,
|
|
credit: [
|
|
{
|
|
name: 'FML',
|
|
url: 'https://www.fmylife.com/',
|
|
reason: 'FML Data'
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
async run(msg) {
|
|
const { text } = await request.get('http://www.fmylife.com/random');
|
|
const $ = cheerio.load(text, { normalizeWhitespace: true });
|
|
const fml = $('a.block').first().text().trim();
|
|
return msg.say(fml);
|
|
}
|
|
};
|