Explorar o código

Delete voice connection from map on error

Bruce Marriner %!s(int64=8) %!d(string=hai) anos
pai
achega
383a3cf1e0
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      wsapi.go

+ 1 - 0
wsapi.go

@@ -369,6 +369,7 @@ func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *Voi
 	data := voiceChannelJoinOp{4, voiceChannelJoinData{&gID, &cID, mute, deaf}}
 	err = s.wsConn.WriteJSON(data)
 	if err != nil {
+		delete(s.VoiceConnections, gID)
 		return
 	}