mirror of
https://github.com/Balshgit/mosgortrans.git
synced 2025-09-11 13:00:40 +03:00
run through webhook
This commit is contained in:
parent
11f94dff81
commit
210096800a
23
main.py
23
main.py
@ -7,8 +7,6 @@ from aiogram.utils.executor import start_webhook, Executor
|
||||
from mos_gor import logger, parse_site, download_gecko_driver, configure_firefox_driver
|
||||
from settings import API_TOKEN, WEBHOOK_URL, WEBHOOK_PATH, WEBAPP_HOST, WEBAPP_PORT
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
bot = Bot(token=API_TOKEN)
|
||||
dp = Dispatcher(bot)
|
||||
dp.middleware.setup(LoggingMiddleware())
|
||||
@ -56,18 +54,15 @@ async def async_app():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import uvicorn
|
||||
download_gecko_driver()
|
||||
driver = configure_firefox_driver()
|
||||
|
||||
uvicorn.run(async_app(), host=WEBAPP_HOST, port=WEBAPP_PORT)
|
||||
|
||||
# start_webhook(
|
||||
# dispatcher=dp,
|
||||
# webhook_path=WEBHOOK_PATH,
|
||||
# on_startup=on_startup,
|
||||
# on_shutdown=on_shutdown,
|
||||
# skip_updates=True,
|
||||
# host=WEBAPP_HOST,
|
||||
# port=WEBAPP_PORT,
|
||||
# )
|
||||
start_webhook(
|
||||
dispatcher=dp,
|
||||
webhook_path=WEBHOOK_PATH,
|
||||
on_startup=on_startup,
|
||||
on_shutdown=on_shutdown,
|
||||
skip_updates=True,
|
||||
host=WEBAPP_HOST,
|
||||
port=WEBAPP_PORT,
|
||||
)
|
||||
|
@ -12,7 +12,6 @@ httpx = "^0.23.0"
|
||||
wget = "^3.2"
|
||||
loguru = "^0.6.0"
|
||||
python-decouple = "^3.6"
|
||||
uvicorn = "^0.18.2"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user