mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
38 lines
800 B
JavaScript
38 lines
800 B
JavaScript
const Command = require('../../framework/Command');
|
|
const request = require('node-superfetch');
|
|
const cheerio = require('cheerio');
|
|
|
|
module.exports = class LolcatCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'lolcat',
|
|
group: 'edit-text',
|
|
description: 'Converts text to lolcat.',
|
|
credit: [
|
|
{
|
|
name: 'speak lolcat',
|
|
url: 'https://speaklolcat.com/',
|
|
reason: 'Translation Data'
|
|
}
|
|
],
|
|
args: [
|
|
{
|
|
key: 'from',
|
|
label: 'text',
|
|
type: 'string',
|
|
max: 500
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
async run(msg, { from }) {
|
|
const { text } = await request
|
|
.get('https://speaklolcat.com/')
|
|
.query({ from });
|
|
const $ = cheerio.load(text);
|
|
const translated = $('textarea[id="to"]').first().text();
|
|
return msg.say(translated);
|
|
}
|
|
};
|