risa.di¶
Dependency injection for handlers, through linkd.
ComponentContainer
¶
Bases: Container
The linkd container risa opens for each component interaction it dispatches.
Contexts
¶
The linkd contexts risa dispatches in.
A handler runs inside DEFAULT with COMPONENT entered on top, so it can be
injected with anything registered in either. risa adds the ComponentContext and the
hikari.ComponentInteraction to COMPONENT for every click.
Attributes:
-
DEFAULT(Final[Context]) –linkd's root context, the one a lightbulb client shares.
-
COMPONENT(Final[Context]) –Entered for every component interaction.
-
MODAL(Final[Context]) –Reserved for modal submissions.
ModalContainer
¶
Bases: Container
The linkd container reserved for modal submissions, which risa does not dispatch yet.
INJECTED¶
The default value that marks a parameter of a handler or of load() for injection. It is linkd's INJECTED, re-exported so you need no linkd import.