From cb7218152c13fafd18bb250b10a7e987f6c47d20 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 2 Dec 2022 13:01:07 -0500 Subject: [PATCH] Revert "Implementing .strain data source change" This reverts commit 752b86908a92fcb4570cd6ed911e0a9f2a1ae2ed. --- functions.js | 16 ++++++---------- package.json | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/functions.js b/functions.js index 1a72cfe..30bad3a 100644 --- a/functions.js +++ b/functions.js @@ -61,7 +61,7 @@ const functions = { } } - if (isDev) console.log(`Valid Commands Added to Config\n${config.validCommands}`); + if (isDev) console.log('Valid Commands Added to Config'); }, dotCommands(client) { if (!client.dotCommands) client.dotCommands = new Discord.Collection(); @@ -133,10 +133,9 @@ const functions = { for (const row of rows) { const strain = { id: row.id, - name: row.strain, + name: row.name, }; client.strains.set(strain.name, strain); - if (isDev) console.log(strain) } if (isDev) console.log('Strains Collection Built'); } @@ -146,7 +145,6 @@ const functions = { const commandData = {}; // Split the message content at the final instance of a period const finalPeriod = message.content.lastIndexOf('.'); - if(isDev) console.log(message.content); // If the final period is the last character, or doesn't exist if (finalPeriod < 0) { if (isDev) console.log(finalPeriod); @@ -312,8 +310,7 @@ const functions = { strainEmbed.addFields([ { name: 'Strain Name', - value: `${strainInfo.strain}`, - inline: true, + value: `${strainInfo.name}`, }, { name: 'Type', @@ -447,13 +444,12 @@ const functions = { }, strain(commandData, message) { const { strainName } = commandData; - const query = `SELECT id, strain, type, effects, description, flavor, rating FROM strains WHERE strain = ${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 (err) throw err; if (rows != undefined) { commandData.strainInfo = { id: `${rows[0].id}`, - strain: `${rows[0].strain}`, + name: `${rows[0].name}`, type: `${rows[0].type}`, effects: `${rows[0].effects}`, description: `${rows[0].description}`, @@ -465,7 +461,7 @@ const functions = { }); }, strains(client) { - const query = 'SELECT id, strain FROM strains'; + const query = 'SELECT id, name FROM strains'; db.query(query, (err, rows, fields) => { if (err) throw err; functions.collections.strains(rows, client); diff --git a/package.json b/package.json index 87f9215..80f6a6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodbot", - "version": "3.0.1", + "version": "3.0.0", "description": "Nods and Nod Accessories.", "main": "main.js", "dependencies": {