ai-food isn't really ai

This commit is contained in:
Dragon Fire
2020-07-02 21:43:45 -04:00
parent 3e67422a3d
commit 4000145fc1
3 changed files with 8 additions and 11 deletions
@@ -2,13 +2,13 @@ const Command = require('../../structures/Command');
const request = require('node-superfetch');
const cheerio = require('cheerio');
module.exports = class AiFoodCommand extends Command {
module.exports = class FoodCommand extends Command {
constructor(client) {
super(client, {
name: 'ai-food',
aliases: ['this-food-does-not-exist', 'this-snack-does-not-exist', 'ai-snack', 'food', 'snack'],
name: 'food',
aliases: ['this-food-does-not-exist', 'this-snack-does-not-exist', 'ai-snack', 'ai-food', 'snack'],
group: 'random-img',
memberName: 'ai-food',
memberName: 'food',
description: 'Responds with a randomly generated food.',
credit: [
{
@@ -26,10 +26,7 @@ module.exports = class AiFoodCommand extends Command {
const $ = cheerio.load(text);
const img = $('div[class="Absolute-Center"]').first().attr('style').match(/background-image:url\((.+)\);/i);
const name = $('h1[class="snack-description"]').first().text();
return msg.say(
`AI-Generated Food: ${name}`,
img ? { files: [{ attachment: img[1], name: 'ai-food.jpg' }] } : {}
);
return msg.say(name, img ? { files: [{ attachment: img[1], name: 'ai-food.jpg' }] } : {});
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}