Base types and functions for events in Hikari.
- class hikari.events.base_events.Event#
Base event type that all Hikari events should subclass.
- classmethod bitmask()#
Bitmask for this event.
- classmethod dispatches()#
Sequence of the event classes this event is dispatched as.
- class hikari.events.base_events.ExceptionEvent#
Event that is raised when another event handler raises an
Only exceptions that derive from
Exceptionwill be caught. Other exceptions outside this range will propagate past this callback. This prevents event handlers interfering with critical exceptions such as
KeyboardErrorwhich would have potentially undesired side-effects on the application runtime.
- property exc_info: Tuple[Type[Exception], Exception, types.TracebackType | None]#
Exception triplet that follows the same format as
sys.exc_infotiplet consists of the exception type, the exception instance, and the traceback of the exception.
- property shard: hikari.api.shard.GatewayShard | None#
Shard that received the event, if there was one associated.
This may be
Noneif no specific shard was the cause of this exception (e.g. when starting up or shutting down).
- failed_callback: FailedCallbackT[EventT]#
Event callback that threw an exception.
- failed_event: EventT#
Event instance that caused the exception.
- async retry()#
Invoke the failed event again.
If an exception is thrown this time, it will need to be manually caught in-code, or will be discarded.
Retrieve the intents that are required to listen to an event type.
Return True if this event is marked as
Decorate an event type to indicate errors should not be handled.
This is useful for exception event types that you do not want to have invoked recursively.
- hikari.events.base_events.requires_intents(first, *rest)#
Decorate an event type to define what intents it requires.