Browse Source

Revert "Removed onEvent handler"

This reverts commit 974ed749e11696949b50634f8c54adf0cf2448a1.

Deleted the wrong function...
Bruce Marriner 8 years ago
parent
commit
cd065fa61a
1 changed files with 6 additions and 0 deletions
  1. 6 0
      discord.go

+ 6 - 0
discord.go

@@ -225,6 +225,7 @@ func (s *Session) initialize() {
 	s.handlers = map[interface{}][]reflect.Value{}
 	s.handlers = map[interface{}][]reflect.Value{}
 	s.handlersMu.Unlock()
 	s.handlersMu.Unlock()
 
 
+	s.AddHandler(s.onEvent)
 	s.AddHandler(s.onReady)
 	s.AddHandler(s.onReady)
 	s.AddHandler(s.onVoiceServerUpdate)
 	s.AddHandler(s.onVoiceServerUpdate)
 	s.AddHandler(s.onVoiceStateUpdate)
 	s.AddHandler(s.onVoiceStateUpdate)
@@ -235,3 +236,8 @@ func (s *Session) initialize() {
 func (s *Session) onEvent(se *Session, e *Event) {
 func (s *Session) onEvent(se *Session, e *Event) {
 	printEvent(e)
 	printEvent(e)
 }
 }
+
+// onReady handles the ready event.
+func (s *Session) onReady(se *Session, r *Ready) {
+	go s.heartbeat(s.wsConn, s.listening, r.HeartbeatInterval)
+}