From d29be7a47f5effc105e9729add40112afe337e13 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Wed, 31 Jul 2024 21:36:47 -0600 Subject: [PATCH] misc.colors: fix csv loading --- src/modules/misc.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/misc.js b/src/modules/misc.js index 2a46138..07d4f47 100644 --- a/src/modules/misc.js +++ b/src/modules/misc.js @@ -14,6 +14,7 @@ const {tinycolor, random: randomColor} = require("@ctrl/tinycolor"); const sharp = require("sharp"); const net = require("node:net"); const fs = require("node:fs"); +const {resolve} = require("node:path"); const imagesClient = new GoogleImages(hf.apikeys.gimg, hf.apikeys.google); @@ -629,7 +630,7 @@ searchInteraction.callback = async function (interaction) { }; hf.registerCommand(searchInteraction); -const colornamesRaw = fs.readFileSync("../../data/colornames.csv").split("\n"); +const colornamesRaw = fs.readFileSync(resolve(__dirname, "../../data/colornames.csv")).split("\n"); colornamesRaw.shift(); const colornamesMapped = colornamesRaw.map((line) => { const [hex, name] = line.split(",");