aiogram-dialog

Though it is not required, you can use dishka-aiogram_dialog integration. It allows you to inject object into aiogram-dialog handlers.

How to use

  1. Setup aiogram integration

  2. Import decorator

from dishka.integrations.aiogram_dialog import FromDishka, inject
  1. Mark those of your aiogram-dialog handlers and getters parameters which are to be injected with FromDishka[] decorate them using imported @inject decorator.

@inject
async def getter(
    a: FromDishka[RequestDep],
    mock: FromDishka[Mock],
    **kwargs,
):
    ...


@inject
async def on_click(
    event,
    widget,
    manager,
    a: FromDishka[RequestDep],
    mock: FromDishka[Mock],
):
    ...