From fbbf2d486b956b1d6a7a18c3eb00336e5e26029d Mon Sep 17 00:00:00 2001 From: Greg Walker Date: Wed, 20 Nov 2024 09:34:01 -0600 Subject: [PATCH] get the right file path --- src/scripts/dad-joke.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scripts/dad-joke.js b/src/scripts/dad-joke.js index 904152d..01d8aa3 100644 --- a/src/scripts/dad-joke.js +++ b/src/scripts/dad-joke.js @@ -1,5 +1,6 @@ const { directMention } = require("@slack/bolt"); const fs = require("node:fs/promises"); +const path = require("node:path"); const { helpMessage, stats: { incrementStats }, @@ -15,7 +16,9 @@ module.exports = async (app) => { ); const jokes = JSON.parse( - await fs.readFile("./dad-joke.json", { encoding: "utf-8" }), + await fs.readFile(path.join(__dirname, "dad-joke.json"), { + encoding: "utf-8", + }), ); app.message(