Fix writing to incorrect file
This commit is contained in:
parent
1c9e6c34a6
commit
9a5e3f299d
10
src/bot.ts
10
src/bot.ts
|
@ -149,7 +149,7 @@ client.connect().then(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
"messages.json",
|
"./persist/messages.json",
|
||||||
JSON.stringify(session.data),
|
JSON.stringify(session.data),
|
||||||
"utf8",
|
"utf8",
|
||||||
);
|
);
|
||||||
|
@ -184,7 +184,7 @@ client.connect().then(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
"messages.json",
|
"./persist/messages.json",
|
||||||
JSON.stringify(session.data),
|
JSON.stringify(session.data),
|
||||||
"utf8",
|
"utf8",
|
||||||
);
|
);
|
||||||
|
@ -226,7 +226,11 @@ client.connect().then(async () => {
|
||||||
content: `[md]${contentOf(response)}[/md]`,
|
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) {
|
} catch (err) {
|
||||||
logger.error(`fs write failed: ${err}`);
|
logger.error(`fs write failed: ${err}`);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue