fix(bots/discord): attempt to fix sticky messages again

This commit is contained in:
PalmDevs
2025-04-09 20:14:32 +07:00
parent 5c9f4c6638
commit 7564b1a8f0
3 changed files with 9 additions and 4 deletions

View File

@@ -37,4 +37,4 @@
"@types/ws": "^8.18.1",
"typed-emitter": "^2.1.0"
}
}
}

View File

@@ -43,4 +43,4 @@
"discord-api-types": "^0.37.119",
"drizzle-kit": "^0.22.8"
}
}
}

View File

@@ -31,8 +31,13 @@ withContext(on, 'messageCreate', async ({ discord, logger }, msg) => {
store.forceTimerMs,
) as NodeJS.Timeout
else store.forceTimer.refresh()
// Force timer is already active, so we force send
} else store.send()
} else {
// Force timer is already active, so we clear the force timer
store.forceTimerActive = false
clearTimeout(store.forceTimer)
// and force send
store.send(true)
}
}
} else if (!store.forceTimerActive) {
// Both timers aren't active, so we start the timer