aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-12-20 20:55:42 -0800
committerGravatar MarkKoz <[email protected]>2020-02-12 10:07:43 -0800
commitc1a86468df6c157343a9a9f0ac69a22c412c6cdf (patch)
tree6175723b46d072f3da0182765a9220608e7661e9
parentBot: add wait_until_guild_available (diff)
Bot: make the connector attribute private
-rw-r--r--bot/bot.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/bot.py b/bot/bot.py
index c0f31911c..e5b9717db 100644
--- a/bot/bot.py
+++ b/bot/bot.py
@@ -20,17 +20,17 @@ class Bot(commands.Bot):
# Use asyncio for DNS resolution instead of threads so threads aren't spammed.
# Use AF_INET as its socket family to prevent HTTPS related problems both locally
# and in production.
- self.connector = aiohttp.TCPConnector(
+ self._connector = aiohttp.TCPConnector(
resolver=aiohttp.AsyncResolver(),
family=socket.AF_INET,
)
- super().__init__(*args, connector=self.connector, **kwargs)
+ super().__init__(*args, connector=self._connector, **kwargs)
self._guild_available = asyncio.Event()
self.http_session: Optional[aiohttp.ClientSession] = None
- self.api_client = api.APIClient(loop=self.loop, connector=self.connector)
+ self.api_client = api.APIClient(loop=self.loop, connector=self._connector)
log.addHandler(api.APILoggingHandler(self.api_client))
@@ -53,7 +53,7 @@ class Bot(commands.Bot):
async def start(self, *args, **kwargs) -> None:
"""Open an aiohttp session before logging in and connecting to Discord."""
- self.http_session = aiohttp.ClientSession(connector=self.connector)
+ self.http_session = aiohttp.ClientSession(connector=self._connector)
await super().start(*args, **kwargs)