Skip to content

Commit 7564b1a

Browse files
committed
fix(bots/discord): attempt to fix sticky messages again
1 parent 5c9f4c6 commit 7564b1a

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

apis/websocket/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@
3737
"@types/ws": "^8.18.1",
3838
"typed-emitter": "^2.1.0"
3939
}
40-
}
40+
}

bots/discord/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@
4343
"discord-api-types": "^0.37.119",
4444
"drizzle-kit": "^0.22.8"
4545
}
46-
}
46+
}

bots/discord/src/events/discord/messageCreate/stickyMessageReset.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ withContext(on, 'messageCreate', async ({ discord, logger }, msg) => {
3131
store.forceTimerMs,
3232
) as NodeJS.Timeout
3333
else store.forceTimer.refresh()
34-
// Force timer is already active, so we force send
35-
} else store.send()
34+
} else {
35+
// Force timer is already active, so we clear the force timer
36+
store.forceTimerActive = false
37+
clearTimeout(store.forceTimer)
38+
// and force send
39+
store.send(true)
40+
}
3641
}
3742
} else if (!store.forceTimerActive) {
3843
// Both timers aren't active, so we start the timer

0 commit comments

Comments
 (0)