main.gateway.handler.HandshakeHandler.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kord-voice Show documentation
Show all versions of kord-voice Show documentation
Idiomatic Kotlin Wrapper for The Discord API
package dev.kord.voice.gateway.handler
import dev.kord.voice.gateway.*
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.Flow
internal class HandshakeHandler(
flow: Flow,
private val data: DefaultVoiceGatewayData,
private val send: suspend (Command) -> Unit
) : GatewayEventHandler(flow, "HandshakeHandler") {
lateinit var configuration: VoiceGatewayConfiguration
private val identify
get() = Identify(
data.guildId,
data.selfId,
data.sessionId,
configuration.token
)
override suspend fun start() = coroutineScope {
on {
data.reconnectRetry.reset()
send(identify)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy