diff --git a/src/quickbot/bot/handlers/editors/boolean.py b/src/quickbot/bot/handlers/editors/boolean.py index 9481dcb..756816b 100644 --- a/src/quickbot/bot/handlers/editors/boolean.py +++ b/src/quickbot/bot/handlers/editors/boolean.py @@ -71,6 +71,7 @@ async def bool_editor( db_session=kwargs["db_session"], app=kwargs["app"], app_state=kwargs["app_state"], + user=user, message=message, ) diff --git a/src/quickbot/bot/handlers/editors/common.py b/src/quickbot/bot/handlers/editors/common.py index 35143f6..11af109 100644 --- a/src/quickbot/bot/handlers/editors/common.py +++ b/src/quickbot/bot/handlers/editors/common.py @@ -71,7 +71,11 @@ async def show_editor(message: Message | CallbackQuery, **kwargs): ) context = BotContext( - db_session=db_session, app=app, app_state=kwargs["app_state"], message=message + db_session=db_session, + app=app, + app_state=kwargs["app_state"], + user=user, + message=message, ) if field_descriptor.edit_prompt: diff --git a/src/quickbot/bot/handlers/editors/date.py b/src/quickbot/bot/handlers/editors/date.py index 716dcb5..428f65a 100644 --- a/src/quickbot/bot/handlers/editors/date.py +++ b/src/quickbot/bot/handlers/editors/date.py @@ -162,6 +162,7 @@ async def time_picker( db_session=kwargs["db_session"], app=kwargs["app"], app_state=kwargs["app_state"], + user=user, message=message, ) @@ -283,6 +284,7 @@ async def date_picker( db_session=kwargs["db_session"], app=kwargs["app"], app_state=kwargs["app_state"], + user=user, message=message, ) @@ -385,6 +387,7 @@ async def date_picker_year( db_session=kwargs["db_session"], app=app, app_state=kwargs["app_state"], + user=user, message=query, ) diff --git a/src/quickbot/bot/handlers/editors/entity.py b/src/quickbot/bot/handlers/editors/entity.py index 15a1199..bb906ea 100644 --- a/src/quickbot/bot/handlers/editors/entity.py +++ b/src/quickbot/bot/handlers/editors/entity.py @@ -199,6 +199,7 @@ async def render_entity_picker( db_session=db_session, app=kwargs["app"], app_state=kwargs["app_state"], + user=user, message=message, ) diff --git a/src/quickbot/bot/handlers/editors/main.py b/src/quickbot/bot/handlers/editors/main.py index fbce44b..053d694 100644 --- a/src/quickbot/bot/handlers/editors/main.py +++ b/src/quickbot/bot/handlers/editors/main.py @@ -142,6 +142,7 @@ async def field_editor(message: Message | CallbackQuery, **kwargs): db_session=db_session, app=app, app_state=kwargs["app_state"], + user=user, message=message, ) field_sequence = await build_field_sequence( diff --git a/src/quickbot/bot/handlers/editors/main_callbacks.py b/src/quickbot/bot/handlers/editors/main_callbacks.py index 9660e87..c513e03 100644 --- a/src/quickbot/bot/handlers/editors/main_callbacks.py +++ b/src/quickbot/bot/handlers/editors/main_callbacks.py @@ -50,6 +50,7 @@ async def _validate_value( db_session=kwargs["db_session"], app=kwargs["app"], app_state=kwargs["app_state"], + user=kwargs["user"], message=message, ) if iscoroutinefunction(field_descriptor.validator): @@ -220,6 +221,7 @@ async def process_field_edit_callback(message: Message | CallbackQuery, **kwargs db_session=kwargs["db_session"], app=kwargs["app"], app_state=kwargs["app_state"], + user=user, message=message, ) field_sequence = await build_field_sequence( @@ -337,6 +339,7 @@ async def process_field_edit_callback(message: Message | CallbackQuery, **kwargs db_session=db_session, app=app, app_state=kwargs["app_state"], + user=user, message=message, ) diff --git a/src/quickbot/bot/handlers/editors/string.py b/src/quickbot/bot/handlers/editors/string.py index 81c0dd6..750e177 100644 --- a/src/quickbot/bot/handlers/editors/string.py +++ b/src/quickbot/bot/handlers/editors/string.py @@ -91,6 +91,7 @@ async def string_editor( db_session=kwargs["db_session"], app=kwargs["app"], app_state=kwargs["app_state"], + user=user, message=message, ) diff --git a/src/quickbot/bot/handlers/forms/entity_form.py b/src/quickbot/bot/handlers/forms/entity_form.py index 042dce4..7576174 100644 --- a/src/quickbot/bot/handlers/forms/entity_form.py +++ b/src/quickbot/bot/handlers/forms/entity_form.py @@ -98,7 +98,11 @@ async def entity_item( ) context = BotContext( - db_session=db_session, app=app, app_state=kwargs["app_state"], message=query + db_session=db_session, + app=app, + app_state=kwargs["app_state"], + user=user, + message=query, ) if form.form_buttons: diff --git a/src/quickbot/bot/handlers/forms/entity_form_callbacks.py b/src/quickbot/bot/handlers/forms/entity_form_callbacks.py index 31f0ba6..fd2d357 100644 --- a/src/quickbot/bot/handlers/forms/entity_form_callbacks.py +++ b/src/quickbot/bot/handlers/forms/entity_form_callbacks.py @@ -50,7 +50,11 @@ async def entity_delete_callback(query: CallbackQuery, **kwargs): ) context = BotContext( - db_session=db_session, app=app, app_state=kwargs["app_state"], message=query + db_session=db_session, + app=app, + app_state=kwargs["app_state"], + user=user, + message=query, ) if callback_data.data == "yes": diff --git a/src/quickbot/bot/handlers/forms/entity_list.py b/src/quickbot/bot/handlers/forms/entity_list.py index 6fbc555..fbfde35 100644 --- a/src/quickbot/bot/handlers/forms/entity_list.py +++ b/src/quickbot/bot/handlers/forms/entity_list.py @@ -122,6 +122,7 @@ async def entity_list( db_session=db_session, app=app, app_state=kwargs["app_state"], + user=user, message=message, ) diff --git a/src/quickbot/bot/handlers/menu/entities.py b/src/quickbot/bot/handlers/menu/entities.py index 69a69bd..d8bc4ae 100644 --- a/src/quickbot/bot/handlers/menu/entities.py +++ b/src/quickbot/bot/handlers/menu/entities.py @@ -53,6 +53,7 @@ async def entities_menu( db_session=kwargs["db_session"], app=app, app_state=kwargs["app_state"], + user=kwargs["user"], message=message, ), descriptor=entity, diff --git a/src/quickbot/bot/handlers/menu/parameters.py b/src/quickbot/bot/handlers/menu/parameters.py index 00875b5..f7f278a 100644 --- a/src/quickbot/bot/handlers/menu/parameters.py +++ b/src/quickbot/bot/handlers/menu/parameters.py @@ -59,6 +59,7 @@ async def parameters_menu( db_session=kwargs["db_session"], app=kwargs["app"], app_state=kwargs["app_state"], + user=user, message=message, ) diff --git a/src/quickbot/model/descriptors.py b/src/quickbot/model/descriptors.py index 8aec2af..bb22338 100644 --- a/src/quickbot/model/descriptors.py +++ b/src/quickbot/model/descriptors.py @@ -234,10 +234,11 @@ class CommandCallbackContext[UT: UserBase]: @dataclass(kw_only=True) -class BotContext: +class BotContext[UT: UserBase]: db_session: AsyncSession app: "QBotApp" app_state: State + user: UT message: Message | CallbackQuery | None = None