Fix OnReady.

This commit is contained in:
Chris Rhodes 2015-12-31 12:40:36 -08:00
parent d0d51851ab
commit 03379f7128

View file

@ -151,14 +151,14 @@ func (s *Session) event(messageType int, message []byte) (err error) {
switch e.Type { switch e.Type {
case "READY": case "READY":
if s.OnReady != nil { var st Ready
var st Ready if err = unmarshalEvent(e, &st); err == nil {
if err = unmarshalEvent(e, &st); err == nil { if s.OnReady != nil {
s.OnReady(s, st) s.OnReady(s, st)
go s.Heartbeat(st.HeartbeatInterval)
} }
return go s.Heartbeat(st.HeartbeatInterval)
} }
return
case "VOICE_SERVER_UPDATE": case "VOICE_SERVER_UPDATE":
// TEMP CODE FOR TESTING VOICE // TEMP CODE FOR TESTING VOICE
var st VoiceServerUpdate var st VoiceServerUpdate
@ -197,7 +197,7 @@ func (s *Session) event(messageType int, message []byte) (err error) {
} }
return return
} }
/* // Never seen this come in but saw it in another Library. /* Never seen this come in but saw it in another Library.
case "MESSAGE_ACK": case "MESSAGE_ACK":
if s.OnMessageAck != nil { if s.OnMessageAck != nil {
} }