Skip to content
This repository has been archived by the owner on Jan 17, 2021. It is now read-only.

Commit

Permalink
Remove code duplication in ChannelVoiceJoin (bwmarrin#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbix1206 authored and Bios-Marcel committed Jul 22, 2019
1 parent 31ead08 commit 7ac9521
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions wsapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,7 @@ func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *Voi
voice.session = s
voice.Unlock()

// Send the request to Discord that we want to join the voice channel
data := voiceChannelJoinOp{4, voiceChannelJoinData{&gID, &cID, mute, deaf}}
s.wsMutex.Lock()
err = s.wsConn.WriteJSON(data)
s.wsMutex.Unlock()
err = s.ChannelVoiceJoinManual(gID, cID, mute, deaf)
if err != nil {
return
}
Expand Down Expand Up @@ -654,10 +650,6 @@ func (s *Session) ChannelVoiceJoinManual(gID, cID string, mute, deaf bool) (err
s.wsMutex.Lock()
err = s.wsConn.WriteJSON(data)
s.wsMutex.Unlock()
if err != nil {
return
}

return
}

Expand Down

0 comments on commit 7ac9521

Please sign in to comment.