Hook bot into HTTP server

This commit is contained in:
Nexus 2024-01-10 09:50:54 +00:00
parent 2aa541ab60
commit a8803de570

View file

@ -47,6 +47,7 @@ class Client(commands.Bot):
self.web: typing.Optional[asyncio.Task] = None self.web: typing.Optional[asyncio.Task] = None
async def start(self, token: str, *, reconnect: bool = True) -> None: async def start(self, token: str, *, reconnect: bool = True) -> None:
app.state.bot = self
config = uvicorn.Config( config = uvicorn.Config(
app, app,
host=CONFIG["server"].get("host", "0.0.0.0"), host=CONFIG["server"].get("host", "0.0.0.0"),