From 25bb92dc74071e69d03721a06b0865392960ba01 Mon Sep 17 00:00:00 2001 From: Cynthia Date: Sun, 11 Dec 2022 09:53:29 -0700 Subject: [PATCH] null check old message --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index bce467a..fe198b3 100644 --- a/src/index.js +++ b/src/index.js @@ -59,7 +59,7 @@ bot.on("messageCreate", async (msg) => { }); bot.on("messageUpdate", (msg, oldMsg) => { const oneDay = Date.now() - 86400000; - if (msg.timestamp > oneDay && !msg.hasRan && oldMsg.content !== msg.content) { + if (msg.timestamp > oneDay && !msg.hasRan && oldMsg && oldMsg.content !== msg.content) { CommandDispatcher(msg); } });