diff --git a/README.md b/README.md index a02c4c3a..4a983090 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ in the appropriate channel's topic to use it. ## Commands -Total: 393 +Total: 394 ### Utility: @@ -507,6 +507,7 @@ Total: 393 * **hex:** Converts text to hex. * **latlmes:** Creates a Latlmes fake link that redirects to a rickroll. * **lmgtfy:** Creates a LMGTFY link with the query you provide. +* **lolcat:** Converts text to lolcat. * **lowercase:** Converts text to lowercase. * **md5:** Creates a hash of text with the MD5 algorithm. * **mocking:** SenDs TexT lIkE ThiS. @@ -1056,6 +1057,8 @@ here. * soundcloud ([API](https://developers.soundcloud.com/)) - [SPAM Brand](https://www.spam.com/) * spam (Image) +- [speak lolcat](https://speaklolcat.com/) + * lolcat (Translation Data) - [Square Enix](https://square-enix-games.com/) * nobody-name ([Original "Kingdom Hearts" Game](https://www.kingdomhearts.com/home/us/)) * sora-selfie ([Original "Kingdom Hearts" Game](https://www.kingdomhearts.com/home/us/)) diff --git a/commands/edit-text/lolcat.js b/commands/edit-text/lolcat.js new file mode 100644 index 00000000..039b16c9 --- /dev/null +++ b/commands/edit-text/lolcat.js @@ -0,0 +1,44 @@ +const Command = require('../../structures/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', + memberName: 'lolcat', + description: 'Converts text to lolcat.', + credit: [ + { + name: 'speak lolcat', + url: 'https://speaklolcat.com/', + reason: 'Translation Data' + } + ], + args: [ + { + key: 'from', + label: 'text', + prompt: 'What text would you like to convert to lolcat?', + type: 'string', + max: 500 + } + ] + }); + } + + async run(msg, { from }) { + try { + 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); + } catch (err) { + return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); + } + } +}; + diff --git a/package.json b/package.json index 0e7649be..7ff6fc0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "113.7.1", + "version": "113.8.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {