You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By allowing users to bypass discordgo's builtin voice connection management, they can use third-party voice solutions such as Lavalink
The only changes necessary to the lib would be adding a public function to discordgo.Session to send an op4 to Discord to initiate the voice handshake and return a VOICE_SERVER_UPDATE. The library already exposes an event for VOICE_SERVER_UPDATE with the proper fields; however, the library also intercepts this event and uses it to complete its own voice connection.
This would be a pretty simple change, and should only end up being something like
func (s*Session) ChannelVoiceJoinManual(gID, cIDstring, mute, deafbool) (errerror) {
// ripped from https://github.com/bwmarrin/discordgo/blob/master/wsapi.go#L598// Send the request to Discord that we want to join the voice channeldata:=voiceChannelJoinOp{4, voiceChannelJoinData{&gID, &cID, mute, deaf}}
s.wsMutex.Lock()
err=s.wsConn.WriteJSON(data)
s.wsMutex.Unlock()
iferr!=nil {
return
}
}
The text was updated successfully, but these errors were encountered:
This resolvesbwmarrin#577.
ChannelVoiceJoinManual is a wrapper over sending an OP4 to Discord, for
initiating a voice server connection. The library's builtin voice
connection management locks/maps are skipped, and the library will not
attempt to manage this voice connection.
Users are expected to hook the VoiceServerUpdate event and forward the
data to an outside voice manager, such as Lavalink.
By allowing users to bypass discordgo's builtin voice connection management, they can use third-party voice solutions such as Lavalink
The only changes necessary to the lib would be adding a public function to
discordgo.Session
to send an op4 to Discord to initiate the voice handshake and return a VOICE_SERVER_UPDATE. The library already exposes an event for VOICE_SERVER_UPDATE with the proper fields; however, the library also intercepts this event and uses it to complete its own voice connection.This would be a pretty simple change, and should only end up being something like
The text was updated successfully, but these errors were encountered: