mirror of
https://github.com/Balshgit/mosgortrans.git
synced 2025-09-11 13:00:40 +03:00
26 lines
609 B
Python
26 lines
609 B
Python
import sys
|
|
from pathlib import Path
|
|
|
|
from aiohttp import web
|
|
|
|
sys.path.append(str(Path(__file__).parent.parent))
|
|
|
|
from app.settings import START_WITH_WEBHOOK, WEBAPP_HOST, WEBAPP_PORT
|
|
from core.application import Application
|
|
|
|
|
|
async def create_app() -> web.Application:
|
|
application = Application()
|
|
return application.create_app()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
application = Application()
|
|
app = application.create_app()
|
|
|
|
if START_WITH_WEBHOOK:
|
|
web.run_app(app=app, host=WEBAPP_HOST, port=WEBAPP_PORT)
|
|
else:
|
|
application.scheduler.start()
|
|
application.bot_polling()
|