Skip to content

Commit

Permalink
fix(client): fix aiohttp session has no running loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Edint386 committed Sep 17, 2024
1 parent 68959fb commit c4d4925
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion heychat/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Client:
def __init__(self, token, gate):
self.token = token
self.base_url = 'https://chat.xiaoheihe.cn'
self.session = aiohttp.ClientSession()
self.session = None
self.gate: Gateway = gate
self.headers = {'token': token}
self.params = {
Expand Down Expand Up @@ -45,4 +45,5 @@ async def requestor(self, method, endpoint, **kwargs):
return await self.gate.request(method, endpoint, **kwargs)

async def start(self):
self.session = aiohttp.ClientSession()
await asyncio.gather(self.gate.run())

0 comments on commit c4d4925

Please sign in to comment.