command-mk2-0.1.1
توضیحات
Custom version of Command filter for aiogram 3
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | command-mk2-0.1.1 |
| نام | command-mk2 |
| نسخه کتابخانه | 0.1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Aleksandr Antonov |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/AbstractiveNord/CommandMk2 |
| آدرس اینترنتی | https://pypi.org/project/command-mk2/ |
| مجوز | MIT |
### Filter CommandMk2 Aiogram 3

---
Improved command filter
```python
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.
نیازمندی
| مقدار | نام |
|---|---|
| ==3.0.0b5 | aiogram |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10,<4.0 | Python |
نحوه نصب
نصب پکیج whl command-mk2-0.1.1:
pip install command-mk2-0.1.1.whl
نصب پکیج tar.gz command-mk2-0.1.1:
pip install command-mk2-0.1.1.tar.gz