Fix writing to incorrect file

This commit is contained in:
powermaker450 2024-07-26 01:26:50 -04:00
parent 1c9e6c34a6
commit 9a5e3f299d

View file

@ -149,7 +149,7 @@ client.connect().then(async () => {
});
fs.writeFileSync(
"messages.json",
"./persist/messages.json",
JSON.stringify(session.data),
"utf8",
);
@ -184,7 +184,7 @@ client.connect().then(async () => {
});
fs.writeFileSync(
"messages.json",
"./persist/messages.json",
JSON.stringify(session.data),
"utf8",
);
@ -226,7 +226,11 @@ client.connect().then(async () => {
content: `[md]${contentOf(response)}[/md]`,
});
fs.writeFileSync("messages.json", JSON.stringify(session.data), "utf8");
fs.writeFileSync(
"./persist/messages.json",
JSON.stringify(session.data),
"utf8",
);
} catch (err) {
logger.error(`fs write failed: ${err}`);