All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.gateway.handler.HandshakeHandler.kt Maven / Gradle / Ivy

There is a newer version: 0.15.0
Show newest version
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