diff --git a/dist/bot.js b/dist/bot.js index ff50669..a17c942 100644 --- a/dist/bot.js +++ b/dist/bot.js @@ -184,6 +184,11 @@ class OcrccBot { timeZone: "America/New_York" }); const filepath = this.localStorage.getItem(`${roomId}-transcript`); + + if (!filepath) { + return _logger.default.log("error", `NO TRANSCRIPT FILE FOR ROOM: ${roomId}`); + } + const message = `${sender} [${time}]: ${content.body}\n`; fs.appendFileSync(filepath, message, "utf8"); } catch (err) { diff --git a/src/bot.js b/src/bot.js index 96401ff..9581973 100644 --- a/src/bot.js +++ b/src/bot.js @@ -173,6 +173,11 @@ class OcrccBot { timeZone: "America/New_York" }); const filepath = this.localStorage.getItem(`${roomId}-transcript`) + + if (!filepath) { + return logger.log("error", `NO TRANSCRIPT FILE FOR ROOM: ${roomId}`); + } + const message = `${sender} [${time}]: ${content.body}\n`; fs.appendFileSync(filepath, message, "utf8");