fix message editing causing crashes

This commit is contained in:
Cynthia Foxwell 2022-12-11 09:39:47 -07:00
parent 9ee00391dd
commit 6195a8646b

View file

@ -57,10 +57,10 @@ for (const file of fs.readdirSync(resolve(__dirname, "modules"))) {
bot.on("messageCreate", async (msg) => {
await CommandDispatcher(msg);
});
bot.on("messageUpdate", (oldMsg, newMsg) => {
bot.on("messageUpdate", (msg, oldMsg) => {
const oneDay = Date.now() - 86400000;
if (newMsg.timestamp > oneDay && !newMsg.hasRan && oldMsg.content !== newMsg.content) {
CommandDispatcher(newMsg);
if (msg.timestamp > oneDay && !msg.hasRan && oldMsg.content !== msg.content) {
CommandDispatcher(msg);
}
});