From 94b70b57a53622e7aaadf20fd3363e807c4f7ace Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sun, 28 Aug 2022 11:25:15 +0300 Subject: [PATCH] bugfix --- structure/JsonCache.js | 4 ++-- structure/Modmail.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/structure/JsonCache.js b/structure/JsonCache.js index 4c9aaae..4ca6a92 100644 --- a/structure/JsonCache.js +++ b/structure/JsonCache.js @@ -48,7 +48,7 @@ class JsonCache extends CacheHandler { savePersistentCache () { this.logger.debug('Saving cache'); - fs.writeFileSync('./persistent_cache.json', JSON.stringify(this.json)); + fs.writeFileSync('./persistent_cache.json', JSON.stringify(this.json, null, 4)); } saveModmailHistory () { @@ -62,7 +62,7 @@ class JsonCache extends CacheHandler { for (const id of toSave) { const path = `./modmail_cache/${id}.json`; try { - fs.writeFileSync(path, JSON.stringify(this.modmail[id])); + fs.writeFileSync(path, JSON.stringify(this.modmail[id], null, 4)); } catch (err) { this.client.logger.error(`Error during saving of history\n${id}\n${JSON.stringify(this.modmail)}\n${err.stack}`); } diff --git a/structure/Modmail.js b/structure/Modmail.js index 1cb00e0..cd5e0a7 100644 --- a/structure/Modmail.js +++ b/structure/Modmail.js @@ -378,7 +378,7 @@ class Modmail { if (!amount) { if (this.lastReminder) { - await this.lastReminder.delete(); + await this.lastReminder.delete().catch(() => null); this.lastReminder = null; } return;