Skip to content

Commit 9366ee3

Browse files
committed
Run BotOwnersImpl#onInjectedJDA async
So it doesn't block the main thread unnecessarily, getting the owners will block until the value is set anyway
1 parent ba842f2 commit 9366ee3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ internal class BotOwnersImpl internal constructor(
4444

4545
override fun isOwner(user: UserSnowflake): Boolean = user.idLong in owners
4646

47-
@BEventListener
47+
@BEventListener(mode = BEventListener.RunMode.ASYNC)
4848
internal suspend fun onInjectedJDA(event: InjectedJDAEvent) {
4949
if (ownerWriter.isInitialized()) return
5050

0 commit comments

Comments
 (0)