mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-03-05 11:08:50 +00:00
Fix aiohttp websocket timeout deprecation warning
This commit is contained in:
@@ -551,11 +551,16 @@ class HTTPClient:
|
|||||||
self.__session = MISSING
|
self.__session = MISSING
|
||||||
|
|
||||||
async def ws_connect(self, url: str, *, compress: int = 0) -> aiohttp.ClientWebSocketResponse:
|
async def ws_connect(self, url: str, *, compress: int = 0) -> aiohttp.ClientWebSocketResponse:
|
||||||
|
try:
|
||||||
|
timeout: Any = aiohttp.ClientWSTimeout(ws_close=30.0) # pyright: ignore[reportCallIssue]
|
||||||
|
except (AttributeError, TypeError):
|
||||||
|
timeout = 30.0
|
||||||
|
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'proxy_auth': self.proxy_auth,
|
'proxy_auth': self.proxy_auth,
|
||||||
'proxy': self.proxy,
|
'proxy': self.proxy,
|
||||||
'max_msg_size': 0,
|
'max_msg_size': 0,
|
||||||
'timeout': 30.0,
|
'timeout': timeout,
|
||||||
'autoclose': False,
|
'autoclose': False,
|
||||||
'headers': {
|
'headers': {
|
||||||
'User-Agent': self.user_agent,
|
'User-Agent': self.user_agent,
|
||||||
|
|||||||
Reference in New Issue
Block a user