Skip to content

Latest commit

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Filter CommandMk2 Aiogram 3

Python


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

About

Advanced command filter for aiogram 3

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages