Improved command filter
class RestrictModel(BaseModel):
period: date
reason: Optional[str]
@router.message(CommandMk2('ban {period} {reason}', response_model=RestrictModel, response_model_name='vars'))
async def ban_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