Custom version of Command filter for aiogram 3
Project description
Filter CommandMk2 Aiogram 3
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
command_mk2-0.1.1.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for command_mk2-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3054b2ff5dd24979d064988250ab4cfd30c24cb067bcfc9ddca4bb12094b5e4 |
|
MD5 | 5c6e438c3ba4b5cd101e94ce3b27f726 |
|
BLAKE2b-256 | d40fdeabc5d1f2b86f69b4bcd0122a1a1f3d29c4e26186ae37d5204290da2f39 |