add bot entity's events, external bot command call
This commit is contained in:
@@ -122,7 +122,7 @@ class _BaseFieldDescriptor:
|
||||
localizable: bool = False
|
||||
bool_false_value: str | LazyProxy = "no"
|
||||
bool_true_value: str | LazyProxy = "yes"
|
||||
ep_form: str | None = None
|
||||
ep_form: str | Callable[["BotContext"], str] | None = None
|
||||
ep_parent_field: str | None = None
|
||||
ep_child_field: str | None = None
|
||||
dt_type: Literal["date", "datetime"] = "date"
|
||||
@@ -195,9 +195,20 @@ class _BaseEntityDescriptor:
|
||||
EntityPermission.DELETE_ALL: [RoleBase.SUPER_USER],
|
||||
}
|
||||
)
|
||||
before_create: Callable[["BotContext"], Union[bool, str]] | None = None
|
||||
before_create_save: (
|
||||
Callable[["BotEntity", "BotContext"], Union[bool, str]] | None
|
||||
) = None
|
||||
before_update_save: (
|
||||
Callable[[dict[str, Any], dict[str, Any], "BotContext"], Union[bool, str]]
|
||||
| None
|
||||
) = None
|
||||
before_delete: Callable[["BotEntity", "BotContext"], Union[bool, str]] | None = None
|
||||
on_created: Callable[["BotEntity", "BotContext"], None] | None = None
|
||||
on_deleted: Callable[["BotEntity", "BotContext"], None] | None = None
|
||||
on_updated: Callable[["BotEntity", "BotContext"], None] | None = None
|
||||
on_updated: Callable[[dict[str, Any], "BotEntity", "BotContext"], None] | None = (
|
||||
None
|
||||
)
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@@ -220,6 +231,7 @@ class CommandCallbackContext[UT: UserBase]:
|
||||
)
|
||||
message_text: str | None = None
|
||||
register_navigation: bool = True
|
||||
clear_navigation: bool = False
|
||||
message: Message | CallbackQuery
|
||||
callback_data: ContextData
|
||||
db_session: AsyncSession
|
||||
|
||||
Reference in New Issue
Block a user