DiscordVoiceConnection
The DiscordVoiceConnection
class handles the voice connection functionalities for Discord-Luau. This class is responsible for managing the lifecycle of a voice connection, handling websocket operations, and ensuring proper communication with Discord’s voice servers.
Properties
voiceWebsocket
voiceUDP
reporter
heartbeatTask
resumeSessionId
heartbeatInterval
heartbeatAck
heartbeatPing
heartbeatNonce
heartbeatClockTime
encryptionKey
mediaSessionId
channelId
guildId
voiceServerUpdate
voiceStateUpdate
{ sessionId: string } }
onEvent
Methods
observeWebsocketErrors
DiscordVoiceConnection : observeWebsocketErrors () -> ()
self: DiscordVoiceConnection
Observes and handles errors from the voice websocket.
observeWebsocketOperations
DiscordVoiceConnection : observeWebsocketOperations () -> ()
self: DiscordVoiceConnection
Observes and handles operations received from the voice websocket.
heartbeatAsync
DiscordVoiceConnection : heartbeatAsync () -> Vendor.Future
self: DiscordVoiceConnection
ignoreHeartbeatAck: boolean?
Sends a heartbeat to the voice websocket and manages the heartbeat acknowledgements.
heartbeatIn
DiscordVoiceConnection : heartbeatIn () -> ()
self: DiscordVoiceConnection
milliseconds: number
Schedules the next heartbeat to be sent after a specified interval.
connectAsync
DiscordVoiceConnection : connectAsync () -> Vendor.Future
self: DiscordVoiceConnection
guildId: string
channelId: string
Connects to a voice channel asynchronously.
resumeAsync
DiscordVoiceConnection : resumeAsync () -> Vendor.Future
self: DiscordVoiceConnection
Resumes a voice connection asynchronously.
reconnectAsync
DiscordVoiceConnection : reconnectAsync () -> Vendor.Future
self: DiscordVoiceConnection
Reconnects to the voice websocket asynchronously.
disconnectAsync
DiscordVoiceConnection : disconnectAsync () -> Vendor.Future
self: DiscordVoiceConnection
Disconnects from the voice websocket asynchronously.
Functions
new
DiscordVoiceConnection . new () -> ()
discordClient: any
id: string
Creates a new instance of DiscordVoiceConnection
.