diff options
| -rw-r--r-- | botcore/_bot.py | 15 | ||||
| -rw-r--r-- | pyproject.toml | 2 | 
2 files changed, 10 insertions, 7 deletions
diff --git a/botcore/_bot.py b/botcore/_bot.py index a43bb344..6486670d 100644 --- a/botcore/_bot.py +++ b/botcore/_bot.py @@ -69,12 +69,8 @@ class BotBase(commands.Bot):          self.api_client: Optional[APIClient] = None -        self._resolver = aiohttp.AsyncResolver() -        self._connector = aiohttp.TCPConnector( -            resolver=self._resolver, -            family=socket.AF_INET, -        ) -        self.http.connector = self._connector +        self._resolver: Optional[aiohttp.AsyncResolver] = None +        self._connector: Optional[aiohttp.TCPConnector] = None          self.statsd_url: Optional[str] = None          self._statsd_timerhandle: Optional[asyncio.TimerHandle] = None @@ -213,6 +209,13 @@ class BotBase(commands.Bot):          """          loop = asyncio.get_running_loop() +        self._resolver = aiohttp.AsyncResolver() +        self._connector = aiohttp.TCPConnector( +            resolver=self._resolver, +            family=socket.AF_INET, +        ) +        self.http.connector = self._connector +          self._connect_statsd(self.statsd_url, loop)          self.stats = AsyncStatsClient(loop, "127.0.0.1")          await self.stats.create_socket() diff --git a/pyproject.toml b/pyproject.toml index ad5aa85c..97bf8ab3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@  [tool.poetry]  name = "bot-core" -version = "5.0.0" +version = "5.0.1"  description = "Bot-Core provides the core functionality and utilities for the bots of the Python Discord community."  authors = ["Python Discord <[email protected]>"]  license = "MIT"  |