misc.colors: fix csv loading
This commit is contained in:
parent
e54f953fa1
commit
d29be7a47f
1 changed files with 2 additions and 1 deletions
|
@ -14,6 +14,7 @@ const {tinycolor, random: randomColor} = require("@ctrl/tinycolor");
|
||||||
const sharp = require("sharp");
|
const sharp = require("sharp");
|
||||||
const net = require("node:net");
|
const net = require("node:net");
|
||||||
const fs = require("node:fs");
|
const fs = require("node:fs");
|
||||||
|
const {resolve} = require("node:path");
|
||||||
|
|
||||||
const imagesClient = new GoogleImages(hf.apikeys.gimg, hf.apikeys.google);
|
const imagesClient = new GoogleImages(hf.apikeys.gimg, hf.apikeys.google);
|
||||||
|
|
||||||
|
@ -629,7 +630,7 @@ searchInteraction.callback = async function (interaction) {
|
||||||
};
|
};
|
||||||
hf.registerCommand(searchInteraction);
|
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();
|
colornamesRaw.shift();
|
||||||
const colornamesMapped = colornamesRaw.map((line) => {
|
const colornamesMapped = colornamesRaw.map((line) => {
|
||||||
const [hex, name] = line.split(",");
|
const [hex, name] = line.split(",");
|
||||||
|
|
Loading…
Reference in a new issue