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
1 changed files with 3 additions and 3 deletions

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", (msg) => {
bot.on("messageUpdate", (oldMsg, newMsg) => {
const oneDay = Date.now() - 86400000;
if (msg.timestamp > oneDay && !msg.hasRan) {
CommandDispatcher(msg);
if (newMsg.timestamp > oneDay && !newMsg.hasRan && oldMsg.content !== newMsg.content) {
CommandDispatcher(newMsg);
}
});