forked from pothtonswer/discordmuffin
Added logging statements
This commit is contained in:
parent
2b85edc4a1
commit
dd69a7e27f
2 changed files with 4 additions and 0 deletions
2
voice.go
2
voice.go
|
@ -126,6 +126,7 @@ func (v *VoiceConnection) Disconnect() (err error) {
|
||||||
// Close websocket and udp connections
|
// Close websocket and udp connections
|
||||||
v.Close()
|
v.Close()
|
||||||
|
|
||||||
|
v.log(LogInformational, "Deleting VoiceConnection %s", v.GuildID)
|
||||||
delete(v.session.VoiceConnections, v.GuildID)
|
delete(v.session.VoiceConnections, v.GuildID)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -428,6 +429,7 @@ func (v *VoiceConnection) wsHeartbeat(wsConn *websocket.Conn, close <-chan struc
|
||||||
var err error
|
var err error
|
||||||
ticker := time.NewTicker(i * time.Millisecond)
|
ticker := time.NewTicker(i * time.Millisecond)
|
||||||
for {
|
for {
|
||||||
|
v.log(LogDebug, "Sending heartbeat packet")
|
||||||
err = wsConn.WriteJSON(voiceHeartbeatOp{3, int(time.Now().Unix())})
|
err = wsConn.WriteJSON(voiceHeartbeatOp{3, int(time.Now().Unix())})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("wsHeartbeat send error: ", err)
|
log.Println("wsHeartbeat send error: ", err)
|
||||||
|
|
2
wsapi.go
2
wsapi.go
|
@ -377,6 +377,7 @@ func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *Voi
|
||||||
data := voiceChannelJoinOp{4, voiceChannelJoinData{&gID, &cID, mute, deaf}}
|
data := voiceChannelJoinOp{4, voiceChannelJoinData{&gID, &cID, mute, deaf}}
|
||||||
err = s.wsConn.WriteJSON(data)
|
err = s.wsConn.WriteJSON(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
s.log(LogInformational, "Deleting VoiceConnection %s", gID)
|
||||||
delete(s.VoiceConnections, gID)
|
delete(s.VoiceConnections, gID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -385,6 +386,7 @@ func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *Voi
|
||||||
err = voice.waitUntilConnected()
|
err = voice.waitUntilConnected()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
voice.Close()
|
voice.Close()
|
||||||
|
s.log(LogInformational, "Deleting VoiceConnection %s", gID)
|
||||||
delete(s.VoiceConnections, gID)
|
delete(s.VoiceConnections, gID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue