Parcourir la source

Merge pull request #159 from iopred/ordering

Fix ordering of the OnReady event and Session being updated.
Bruce il y a 8 ans
Parent
commit
4c9d6e78b1
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      discord.go

+ 2 - 2
discord.go

@@ -201,13 +201,13 @@ func (s *Session) handle(event interface{}) {
 
 	handlerParameters := []reflect.Value{reflect.ValueOf(s), reflect.ValueOf(event)}
 
-	if handlers, ok := s.handlers[reflect.TypeOf(event)]; ok {
+	if handlers, ok := s.handlers[nil]; ok {
 		for _, handler := range handlers {
 			handler.Call(handlerParameters)
 		}
 	}
 
-	if handlers, ok := s.handlers[nil]; ok {
+	if handlers, ok := s.handlers[reflect.TypeOf(event)]; ok {
 		for _, handler := range handlers {
 			handler.Call(handlerParameters)
 		}