diff --git a/bots/discord/src/events/discord/messageCreate/stickyMessageReset.ts b/bots/discord/src/events/discord/messageCreate/stickyMessageReset.ts index e0104ac..2b18fd9 100644 --- a/bots/discord/src/events/discord/messageCreate/stickyMessageReset.ts +++ b/bots/discord/src/events/discord/messageCreate/stickyMessageReset.ts @@ -7,12 +7,13 @@ withContext(on, 'messageCreate', async ({ discord, logger }, msg) => { const store = discord.stickyMessages[msg.guildId]?.[msg.channelId] if (!store) return + const timerPreviouslyActive = store.timerActive // If there isn't a timer, start it up store.timerActive = true if (!store.timer) store.timer = setTimeout(store.send, store.timerMs) as NodeJS.Timeout else { // If there is a timer, but it isn't active, restart it - if (!store.timerActive) store.timer.refresh() + if (!timerPreviouslyActive) store.timer.refresh() // If there is a timer and it is active, but the force timer isn't active... else if (!store.forceTimerActive && store.forceTimerMs) { logger.debug(`Channel ${msg.channelId} in guild ${msg.guildId} is active, starting force send timer and clearing existing timer`)