null check old message
This commit is contained in:
		
							parent
							
								
									6195a8646b
								
							
						
					
					
						commit
						25bb92dc74
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -59,7 +59,7 @@ bot.on("messageCreate", async (msg) => {
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
bot.on("messageUpdate", (msg, oldMsg) => {
 | 
					bot.on("messageUpdate", (msg, oldMsg) => {
 | 
				
			||||||
  const oneDay = Date.now() - 86400000;
 | 
					  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);
 | 
					    CommandDispatcher(msg);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue