mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 06:37:32 +02:00
ai-food isn't really ai
This commit is contained in:
@@ -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!`);
|
||||
}
|
||||
Reference in New Issue
Block a user