Name | aiogram_album JSON |
Version |
0.0.4b0
JSON |
| download |
home_page | |
Summary | 😎 |
upload_time | 2024-01-21 15:29:34 |
maintainer | |
docs_url | None |
author | RootShinobi |
requires_python | >=3.8,<4.0 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# aiogram album
## Base handler
```python
from aiogram_album import AlbumMessage
@router.message(F.media_group_id)
async def media_handler(message: AlbumMessage):
await message.reply(
f"album\n"
f"size: {len(message)}\n"
f"content types: {[m.content_type.value for m in message]}"
)
```
## PyrogramAlbumMiddleware
_Install_
```bash
pip install aiogram_album Pyrogram cachetools TgCrypto
```
_Usage_
> [!CAUTION]
> Obtain the API key by following Telegram’s instructions and rules at https://core.telegram.org/api/obtaining_api_id
```python
from aiogram_album.pyrogram_album.middleware import PyrogramAlbumMiddleware
await PyrogramAlbumMiddleware.from_app_data(
bot_token=BOT_TOKEN,
api_id=API_ID,
api_hash=API_HASH,
router=dp,
)
```
or
```python
from aiogram_album.pyrogram_album.middleware import PyrogramAlbumMiddleware
from pyrogram import Client
from aiogram import Bot
bot = Bot(BOT_TOKEN)
client = Client(str(bot.id), bot_token=BOT_TOKEN, api_hash=API_HASH, api_id=API_ID, no_updates=True)
await client.start()
PyrogramAlbumMiddleware(
client=client,
router=dp,
)
```
## TTLCacheAlbumMiddleware
_Install_
```bash
pip install aiogram_album cachetools
```
_Usage_
```python
from aiogram_album.ttl_cache_middleware import TTLCacheAlbumMiddleware
TTLCacheAlbumMiddleware(router=dp)
```
## CountCheckAlbumMiddleware
_Install_
```bash
pip install aiogram_album
```
_Usage_
```python
from aiogram_album.count_check_middleware import CountCheckAlbumMiddleware
CountCheckAlbumMiddleware(router=dp)
```
## WithoutCountCheckAlbumMiddleware
_Install_
```bash
pip install aiogram_album
```
_Usage_
```python
from aiogram_album.no_check_count_middleware import WithoutCountCheckAlbumMiddleware
WithoutCountCheckAlbumMiddleware(router=dp)
```
## LockAlbumMiddleware
_Install_
```bash
pip install aiogram_album cachetools
```
_Usage_
```python
from aiogram_album.lock_middleware import LockAlbumMiddleware
LockAlbumMiddleware(router=dp)
```
Raw data
{
"_id": null,
"home_page": "",
"name": "aiogram_album",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "RootShinobi",
"author_email": "111008396+RootShinobi@users.noreply.github.com",
"download_url": "https://files.pythonhosted.org/packages/46/4e/efa1d797cda936f57f99b2b583e407c63ab60fee4946f97b5ff7eb2e6e2c/aiogram_album-0.0.4b0.tar.gz",
"platform": null,
"description": "# aiogram album\n\n## Base handler\n```python\nfrom aiogram_album import AlbumMessage\n\n@router.message(F.media_group_id)\nasync def media_handler(message: AlbumMessage):\n await message.reply(\n f\"album\\n\"\n f\"size: {len(message)}\\n\"\n f\"content types: {[m.content_type.value for m in message]}\"\n )\n```\n\n## PyrogramAlbumMiddleware\n_Install_\n```bash\npip install aiogram_album Pyrogram cachetools TgCrypto\n```\n_Usage_\n\n> [!CAUTION]\n> Obtain the API key by following Telegram\u2019s instructions and rules at https://core.telegram.org/api/obtaining_api_id\n\n```python\nfrom aiogram_album.pyrogram_album.middleware import PyrogramAlbumMiddleware\n\n\n\nawait PyrogramAlbumMiddleware.from_app_data(\n bot_token=BOT_TOKEN,\n api_id=API_ID,\n api_hash=API_HASH,\n router=dp,\n)\n```\nor\n\n```python\nfrom aiogram_album.pyrogram_album.middleware import PyrogramAlbumMiddleware\nfrom pyrogram import Client\nfrom aiogram import Bot\n\nbot = Bot(BOT_TOKEN)\nclient = Client(str(bot.id), bot_token=BOT_TOKEN, api_hash=API_HASH, api_id=API_ID, no_updates=True)\nawait client.start()\n\nPyrogramAlbumMiddleware(\n client=client,\n router=dp,\n)\n\n\n```\n\n## TTLCacheAlbumMiddleware\n_Install_\n```bash\npip install aiogram_album cachetools\n```\n_Usage_\n```python\nfrom aiogram_album.ttl_cache_middleware import TTLCacheAlbumMiddleware\n\n\nTTLCacheAlbumMiddleware(router=dp)\n```\n\n## CountCheckAlbumMiddleware\n_Install_\n```bash\npip install aiogram_album\n```\n_Usage_\n```python\nfrom aiogram_album.count_check_middleware import CountCheckAlbumMiddleware\n\n\nCountCheckAlbumMiddleware(router=dp)\n```\n\n## WithoutCountCheckAlbumMiddleware\n_Install_\n```bash\npip install aiogram_album\n```\n_Usage_\n```python\nfrom aiogram_album.no_check_count_middleware import WithoutCountCheckAlbumMiddleware\n\n\nWithoutCountCheckAlbumMiddleware(router=dp)\n```\n\n## LockAlbumMiddleware\n_Install_\n```bash\npip install aiogram_album cachetools\n```\n_Usage_\n```python\nfrom aiogram_album.lock_middleware import LockAlbumMiddleware\n\n\nLockAlbumMiddleware(router=dp)\n```",
"bugtrack_url": null,
"license": "",
"summary": "\ud83d\ude0e",
"version": "0.0.4b0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0a818912238fd77bd7edd8b46bf236873ce1f0184b8b84f591fff1920dfb03a9",
"md5": "28f7b91d150bae652f561a20f06735dd",
"sha256": "a1d7dbe7a880da01ad15cb8df4af35bf16a3b3490b8422ea403fb32e75732ea6"
},
"downloads": -1,
"filename": "aiogram_album-0.0.4b0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "28f7b91d150bae652f561a20f06735dd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 26590,
"upload_time": "2024-01-21T15:29:32",
"upload_time_iso_8601": "2024-01-21T15:29:32.230813Z",
"url": "https://files.pythonhosted.org/packages/0a/81/8912238fd77bd7edd8b46bf236873ce1f0184b8b84f591fff1920dfb03a9/aiogram_album-0.0.4b0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "464eefa1d797cda936f57f99b2b583e407c63ab60fee4946f97b5ff7eb2e6e2c",
"md5": "73a0c79218b635e56487db4cb84d9368",
"sha256": "6fe43b2249d065606eabd59b5f3d0a149fbef4e7e6a1532bf43592568db8dbdf"
},
"downloads": -1,
"filename": "aiogram_album-0.0.4b0.tar.gz",
"has_sig": false,
"md5_digest": "73a0c79218b635e56487db4cb84d9368",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 20016,
"upload_time": "2024-01-21T15:29:34",
"upload_time_iso_8601": "2024-01-21T15:29:34.195677Z",
"url": "https://files.pythonhosted.org/packages/46/4e/efa1d797cda936f57f99b2b583e407c63ab60fee4946f97b5ff7eb2e6e2c/aiogram_album-0.0.4b0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-21 15:29:34",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "aiogram_album"
}