Fix AutoShardedClient to work with the new asyncio loop machinery

Fix #7675
This commit is contained in:
Rapptz
2022-03-13 08:05:44 -04:00
parent 049df7c586
commit 8d4f08a5e7
4 changed files with 10 additions and 9 deletions

View File

@@ -169,10 +169,10 @@ class ConnectionState:
handlers: Dict[str, Callable],
hooks: Dict[str, Callable],
http: HTTPClient,
loop: asyncio.AbstractEventLoop,
**options: Any,
) -> None:
self.loop: asyncio.AbstractEventLoop = loop
# Set later, after Client.login
self.loop: asyncio.AbstractEventLoop = utils.MISSING
self.http: HTTPClient = http
self.max_messages: Optional[int] = options.get('max_messages', 1000)
if self.max_messages is not None and self.max_messages <= 0: