null check old message

This commit is contained in:
Cynthia Foxwell 2022-12-11 09:53:29 -07:00
parent 6195a8646b
commit 25bb92dc74
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}
});