😎
Project description
aiogram album
Base handler
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
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
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
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
pip install aiogram_album cachetools
Usage
from aiogram_album.ttl_cache_middleware import TTLCacheAlbumMiddleware
TTLCacheAlbumMiddleware(router=dp)
CountCheckAlbumMiddleware
Install
pip install aiogram_album
Usage
from aiogram_album.count_check_middleware import CountCheckAlbumMiddleware
CountCheckAlbumMiddleware(router=dp)
WithoutCountCheckAlbumMiddleware
Install
pip install aiogram_album
Usage
from aiogram_album.no_check_count_middleware import WithoutCountCheckAlbumMiddleware
WithoutCountCheckAlbumMiddleware(router=dp)
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
aiogram_album-0.0.3b0.tar.gz
(20.1 kB
view hashes)
Built Distribution
Close
Hashes for aiogram_album-0.0.3b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 486355f120fd426f097624773b1222035226aed5b4474a24216aae1c533e80d0 |
|
MD5 | 12ea2cfb089ebe80499d0980e5a30777 |
|
BLAKE2b-256 | 85c10c92dfcffa7d24bcea61f9d1b0fe571f76d274378d86b4dc4a0fc20a9089 |