Skip to content

Commit c7f335f

Browse files
authored
[DISC-120] Move to using fs for configuration (#194)
* Declare file type for requiring data * Use json as opposed to js data file * Replace require to use reading file with fs
1 parent 719f36d commit c7f335f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

events/lunch_buddy.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const { EmbedBuilder, ButtonBuilder, ActionRowBuilder } = require("discord.js");
22
const cron = require("node-cron");
3-
const lunchBuddyLocations = require("../data/lunch_buddy_locations.json");
4-
const config = require("../config/lunch_buddy.json");
3+
const fs = require("fs");
4+
5+
const lunchBuddyLocations = JSON.parse(fs.readFileSync("./data/lunch_buddy_locations.json"));
6+
const config = JSON.parse(fs.readFileSync("./config/lunch_buddy.json"));
57

68
const maxRowButtons = 4;
79
const areaButtonCustomId = "AreaButton";

0 commit comments

Comments
 (0)