From ac0011a12f3faa34a813972f2b0cd2e53ffdfd21 Mon Sep 17 00:00:00 2001 From: dondish Date: Fri, 18 Oct 2019 14:38:12 +0300 Subject: [PATCH] updated the develop branch to fix the voice holdup issue --- go.mod | 2 ++ voice.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 2ff8868..8cd2cf6 100644 --- a/go.mod +++ b/go.mod @@ -4,3 +4,5 @@ require ( github.com/gorilla/websocket v1.4.0 golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16 ) + +go 1.13 diff --git a/voice.go b/voice.go index 42fa932..51ac16c 100644 --- a/voice.go +++ b/voice.go @@ -243,6 +243,7 @@ type voiceOP2 struct { Port int `json:"port"` Modes []string `json:"modes"` HeartbeatInterval time.Duration `json:"heartbeat_interval"` + IP string `json:"ip"` } // WaitUntilConnected waits for the Voice Connection to @@ -542,7 +543,7 @@ func (v *VoiceConnection) udpOpen() (err error) { return fmt.Errorf("empty endpoint") } - host := strings.TrimSuffix(v.endpoint, ":80") + ":" + strconv.Itoa(v.op2.Port) + host := v.op2.IP + ":" + strconv.Itoa(v.op2.Port) addr, err := net.ResolveUDPAddr("udp", host) if err != nil { v.log(LogWarning, "error resolving udp host %s, %s", host, err)