From 9857406edd9804da094005bfa560751e98a227c3 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 2 Dec 2022 00:37:58 -0500 Subject: [PATCH] Further updates to match new data source .strain --- functions.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/functions.js b/functions.js index 03c4d1d..30bad3a 100644 --- a/functions.js +++ b/functions.js @@ -327,9 +327,14 @@ const functions = { value: `${strainInfo.flavor}`, inline: true, }, + { + name: 'Rating', + value: `${strainInfo.rating}⭐️`, + inline: true, + }, { name: 'Description', - value: `${strainInfo.ailments}`, + value: `${strainInfo.description}`, inline: false, }, ]); @@ -439,7 +444,7 @@ const functions = { }, strain(commandData, message) { const { strainName } = commandData; - const query = `SELECT id, name, type, effects, ailment, flavor FROM strains WHERE name = ${db.escape(strainName)}`; + const query = `SELECT id, name, type, effects, description, flavor, rating FROM strains WHERE name = ${db.escape(strainName)}`; db.query(query, (err, rows, fields) => { if (rows != undefined) { commandData.strainInfo = { @@ -447,8 +452,9 @@ const functions = { name: `${rows[0].name}`, type: `${rows[0].type}`, effects: `${rows[0].effects}`, - ailments: `${rows[0].ailment}`, + description: `${rows[0].description}`, flavor: `${rows[0].flavor}`, + rating: `${rows[0].rating}`, }; functions.embeds.strain(commandData, message); }