forked from pothtonswer/discordmuffin
Handle VOICE_SERVER_UPDATE better, closes #115
This commit is contained in:
parent
548d61c406
commit
eec0faa7b3
1 changed files with 4 additions and 0 deletions
4
wsapi.go
4
wsapi.go
|
@ -466,6 +466,10 @@ func (s *Session) onVoiceServerUpdate(se *Session, st *VoiceServerUpdate) {
|
|||
s.Voice.endpoint = st.Endpoint
|
||||
s.Voice.guildID = st.GuildID
|
||||
|
||||
// If currently connected to voice ws/udp, then disconnect.
|
||||
// Has no effect if not connected.
|
||||
s.Voice.Close()
|
||||
|
||||
// We now have enough information to open a voice websocket conenction
|
||||
// so, that's what the next call does.
|
||||
err := s.Voice.Open()
|
||||
|
|
Loading…
Reference in a new issue