From cd065fa61aac4a813acb088f79f393956db8707b Mon Sep 17 00:00:00 2001 From: Bruce Marriner Date: Mon, 21 Mar 2016 17:53:15 -0500 Subject: [PATCH] Revert "Removed onEvent handler" This reverts commit 974ed749e11696949b50634f8c54adf0cf2448a1. Deleted the wrong function... --- discord.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/discord.go b/discord.go index 1381024..c2899a0 100644 --- a/discord.go +++ b/discord.go @@ -225,6 +225,7 @@ func (s *Session) initialize() { s.handlers = map[interface{}][]reflect.Value{} s.handlersMu.Unlock() + s.AddHandler(s.onEvent) s.AddHandler(s.onReady) s.AddHandler(s.onVoiceServerUpdate) s.AddHandler(s.onVoiceStateUpdate) @@ -235,3 +236,8 @@ func (s *Session) initialize() { func (s *Session) onEvent(se *Session, e *Event) { printEvent(e) } + +// onReady handles the ready event. +func (s *Session) onReady(se *Session, r *Ready) { + go s.heartbeat(s.wsConn, s.listening, r.HeartbeatInterval) +}