2024-08-12 17:25:30 +03:00
|
|
|
import asyncio
|
|
|
|
|
2024-08-13 23:57:26 +03:00
|
|
|
import uvicorn
|
|
|
|
|
2024-08-12 17:25:30 +03:00
|
|
|
from bot import bot, dp
|
2024-08-13 23:57:26 +03:00
|
|
|
import config
|
2024-08-17 15:29:45 +03:00
|
|
|
from api import api
|
2024-08-13 23:57:26 +03:00
|
|
|
from server import Server
|
|
|
|
|
2024-08-12 17:25:30 +03:00
|
|
|
|
2024-08-13 23:57:26 +03:00
|
|
|
if __name__ == '__main__':
|
|
|
|
config = uvicorn.Config(
|
2024-08-17 15:29:45 +03:00
|
|
|
app=api,
|
2024-08-13 23:57:26 +03:00
|
|
|
host=config.Main.host,
|
|
|
|
port=config.Main.port,
|
|
|
|
)
|
|
|
|
server = Server(
|
|
|
|
config=config,
|
|
|
|
)
|
2024-08-12 17:25:30 +03:00
|
|
|
|
2024-08-13 23:57:26 +03:00
|
|
|
with server.run_in_thread():
|
|
|
|
asyncio.run(dp.run_polling(bot))
|