diff --git a/voice.go b/voice.go index 6fd8d02..282be7a 100644 --- a/voice.go +++ b/voice.go @@ -210,6 +210,12 @@ func (s *Session) VoiceCloseUDP() { func (s *Session) VoiceSpeaking() { + if s.VwsConn == nil { + // TODO return an error + fmt.Println("No Voice websocket.") + return + } + jsonb := []byte(`{"op":5,"d":{"speaking":true,"delay":0}}`) err := s.VwsConn.WriteMessage(websocket.TextMessage, jsonb) if err != nil {