Improved command filter
classRestrictModel(BaseModel):
period: datereason: Optional[str]
@router.message(CommandMk2('ban {period} {reason}', response_model=RestrictModel, response_model_name='vars'))asyncdefban_user(message: Message, period: date, reason: Optional[str]):
...Diff:
- Command arguments parsing, not just leaving single string like built-in aiogram filter
- Command arguments separation and validation using Pydantic model.
Doc is available here