base usage
from aiogram import Dispatcher, Bot
from asgi_aiogram import ASGIAiogram
from asgi_aiogram.strategy import SingleStrategy
from asgi_aiogram.strategy import HttpStrategy
from asgi_aiogram.http_responses import JsonResponse
from asgi_aiogram.http_request import Request
dp = Dispatcher()
@dp.startup()
async def startup(dispatcher: Dispatcher, bot: Bot):
await bot.close()
await bot.set_webhook(
url='https://example.com/bot',
allowed_updates=dispatcher.resolve_used_update_types()
)
async def get(request: Request):
return JsonResponse(body={"status": "ok"})
bot = Bot(token="<token>")
app = ASGIAiogram(
SingleStrategy(path="/bot", bot=bot, dispatcher=dp),
HttpStrategy(path="/health", method="GET", handler=get),
)
uvicorn main:app
Metadata
Release files for asgi_aiogram 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asgi_aiogram-0.3.1.tar.gz | 6.5 kB | Without provenance | Details for asgi_aiogram-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asgi_aiogram-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for asgi_aiogram-0.3.1-py3-none-any.whl |
Total release size: 17.3 kB
Release files / asgi_aiogram-0.3.1.tar.gz
| Download URL | asgi_aiogram-0.3.1.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d692e7b55bd7bfe459666a22911cab3ced26fb24bf8f100d8828bae8ef4f4c42
|
|
BLAKE2b-256 checksum How to use checksums |
f7611292e3513616c0509942cc53d4855a775f3a0dc7911d35a9a9e1927a56f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.11.9 Windows/10
|
Release files / asgi_aiogram-0.3.1-py3-none-any.whl
| Download URL | asgi_aiogram-0.3.1-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c2ad301158d30bb23d41e659addba766c3966da3c2c0185951223e996e716b5
|
|
BLAKE2b-256 checksum How to use checksums |
9381872be064b0a32c09e0a05ef3525b7dec3f3b9abc329bdb77fdbf75412754
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.11.9 Windows/10
|
Security for asgi_aiogram 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.