Browse Source

VoiceServerUpdate and VoiceStateUpdate

Chris Rhodes 9 years ago
parent
commit
40b969d7c3
2 changed files with 3 additions and 2 deletions
  1. 1 0
      structs.go
  2. 2 2
      wsapi.go

+ 1 - 0
structs.go

@@ -46,6 +46,7 @@ type Session struct {
 	OnMessageAck              func(*Session, *MessageAck)
 	OnUserUpdate              func(*Session, *User)
 	OnPresenceUpdate          func(*Session, *PresenceUpdate)
+	OnVoiceServerUpdate       func(*Session, *VoiceServerUpdate)
 	OnVoiceStateUpdate        func(*Session, *VoiceState)
 	OnChannelCreate           func(*Session, *Channel)
 	OnChannelUpdate           func(*Session, *Channel)

+ 2 - 2
wsapi.go

@@ -316,17 +316,17 @@ func (s *Session) event(messageType int, message []byte) {
 			return
 		}
 	case "VOICE_SERVER_UPDATE":
-		// TEMP CODE FOR TESTING VOICE
 		var st *VoiceServerUpdate
 		if err = unmarshalEvent(e, &st); err == nil {
 			s.onVoiceServerUpdate(st)
+			s.OnVoiceServerUpdate(s, st)
 		}
 		return
 	case "VOICE_STATE_UPDATE":
-		// TEMP CODE FOR TESTING VOICE
 		var st *VoiceState
 		if err = unmarshalEvent(e, &st); err == nil {
 			s.onVoiceStateUpdate(st)
+			s.OnVoiceStateUpdate(s, st)
 		}
 		return
 	case "USER_UPDATE":