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 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 settings import API_TOKEN, WEBHOOK_URL, WEBHOOK_PATH, WEBAPP_HOST, WEBAPP_PORT
|
||||||
|
|
||||||
from aiohttp import web
|
|
||||||
|
|
||||||
bot = Bot(token=API_TOKEN)
|
bot = Bot(token=API_TOKEN)
|
||||||
dp = Dispatcher(bot)
|
dp = Dispatcher(bot)
|
||||||
dp.middleware.setup(LoggingMiddleware())
|
dp.middleware.setup(LoggingMiddleware())
|
||||||
@ -56,18 +54,15 @@ async def async_app():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import uvicorn
|
|
||||||
download_gecko_driver()
|
download_gecko_driver()
|
||||||
driver = configure_firefox_driver()
|
driver = configure_firefox_driver()
|
||||||
|
|
||||||
uvicorn.run(async_app(), host=WEBAPP_HOST, port=WEBAPP_PORT)
|
start_webhook(
|
||||||
|
dispatcher=dp,
|
||||||
# start_webhook(
|
webhook_path=WEBHOOK_PATH,
|
||||||
# dispatcher=dp,
|
on_startup=on_startup,
|
||||||
# webhook_path=WEBHOOK_PATH,
|
on_shutdown=on_shutdown,
|
||||||
# on_startup=on_startup,
|
skip_updates=True,
|
||||||
# on_shutdown=on_shutdown,
|
host=WEBAPP_HOST,
|
||||||
# skip_updates=True,
|
port=WEBAPP_PORT,
|
||||||
# host=WEBAPP_HOST,
|
)
|
||||||
# port=WEBAPP_PORT,
|
|
||||||
# )
|
|
||||||
|
@ -12,7 +12,6 @@ httpx = "^0.23.0"
|
|||||||
wget = "^3.2"
|
wget = "^3.2"
|
||||||
loguru = "^0.6.0"
|
loguru = "^0.6.0"
|
||||||
python-decouple = "^3.6"
|
python-decouple = "^3.6"
|
||||||
uvicorn = "^0.18.2"
|
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user