From 1c6dab8193c8fbe8dffb60bbd72de7c6f5e99ea5 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 9 Jun 2020 14:57:03 -0400 Subject: [PATCH] Fix --- commands/random-img/ai-food.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/random-img/ai-food.js b/commands/random-img/ai-food.js index 7d179a16..18f92fd1 100644 --- a/commands/random-img/ai-food.js +++ b/commands/random-img/ai-food.js @@ -26,7 +26,10 @@ 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, name: 'ai-food.jpg' }] } : {}); + return msg.say( + `AI-Generated Food: ${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!`); }