Skip to content

Commit

Permalink
Attempt to fix race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Apr 13, 2021
1 parent d67a990 commit 9642718
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ class WebSocketHandlers(private val contextMap: Map<String, SocketContext>) {

val player = context.getPlayer(guildId)
val conn = context.getVoiceConnection(player)
conn.connect(VoiceServerInfo(sessionId, endpoint, token))
player.provideTo(conn)
conn.connect(VoiceServerInfo(sessionId, endpoint, token)).thenRun {
player.provideTo(conn)
}
}

fun play(context: SocketContext, json: JSONObject) {
Expand Down

0 comments on commit 9642718

Please sign in to comment.