Skip to content

Commit 282cafb

Browse files
committed
Check for any JDA status beyond CONNECTING_TO_WEBSOCKET
This is required for the JDA restart cache module, as it will fire the READY status directly
1 parent 1e00cc7 commit 282cafb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/kotlin/io/github/freya022/botcommands/internal/core/ReadyListener.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ internal class ReadyListener {
2525
@BEventListener(priority = Int.MAX_VALUE, mode = RunMode.BLOCKING)
2626
internal suspend fun onConnectEvent(event: StatusChangeEvent, context: BContext) {
2727
// At this point, JDA should be usable
28-
if (!connected && event.newStatus == JDA.Status.CONNECTING_TO_WEBSOCKET) {
28+
// Use >= because any event beyond this point is a valid JDA instance
29+
if (!connected && event.newStatus >= JDA.Status.CONNECTING_TO_WEBSOCKET) {
2930
lock.withLock {
3031
if (connected) return
3132
connected = true

0 commit comments

Comments
 (0)