Set socket family of connector to AF_INET

- discord doesn't support ipv6
- prevents issues with hosts with DNS64 enabled
- resolves #9442
This commit is contained in:
Michael H 2023-06-04 15:11:16 -07:00 committed by GitHub
parent 914773d0fb
commit e6d2d82803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,7 @@ from typing import (
from urllib.parse import quote as _uriquote
from collections import deque
import datetime
import socket
import aiohttp
@ -784,7 +785,8 @@ class HTTPClient:
async def static_login(self, token: str) -> user.User:
# Necessary to get aiohttp to stop complaining about session creation
if self.connector is MISSING:
self.connector = aiohttp.TCPConnector(limit=0)
# discord does not support ipv6
self.connector = aiohttp.TCPConnector(limit=0, family=socket.AF_INET)
self.__session = aiohttp.ClientSession(
connector=self.connector,