only run edit if content is changed

This commit is contained in:
Cynthia Foxwell 2022-12-10 16:25:12 -07:00
parent d145ff2940
commit 9ee00391dd

View file

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