Fixed spurious double dispatch of every event that occurs (second is always None)
@@ -170,9 +170,10 @@ class EventManager(typing.Generic[EventDispatcherT], raw_event_consumers.RawEven
handler = self.raw_event_mappers[name]
except KeyError:
self.logger.debug("no handler for event %s is registered", name)
- else:
+ return
+
try:
- event = handler(shard_client_obj, payload)
+ handler(shard_client_obj, payload)
except Exception as ex:
self.logger.exception(
"Failed to unmarshal %r event payload. This is likely a bug in Hikari itself. "
@@ -180,5 +181,3 @@ class EventManager(typing.Generic[EventDispatcherT], raw_event_consumers.RawEven
name,
exc_info=ex,
)
- else:
- self.event_dispatcher.dispatch_event(event)
