mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: read file with dir
This commit is contained in:
@@ -9,7 +9,7 @@ const files = await fs.readdir('db/events')
|
||||
|
||||
await Promise.all(
|
||||
files.map(async (file) => {
|
||||
const eventsInFile = Object.values(await fs.readFile(file, 'utf8').then((text) => JSON.parse(text)))
|
||||
const eventsInFile = Object.values(await fs.readFile(`db/events/${file}`, 'utf8').then((text) => JSON.parse(text)))
|
||||
eventsInFile.forEach((eventInFile) => {
|
||||
if (typeof eventInFile === 'string') return
|
||||
events.push(eventInFile)
|
||||
|
||||
Reference in New Issue
Block a user