summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-04-05 16:08:48 +0100
committerGravatar Chris Lovering <[email protected]>2022-04-08 12:04:07 +0100
commit2335970a790a73544565ae0472403fbac8271fe5 (patch)
treec150b2614c6aaee5b3c0244e1fe3c019ad5b9d10
parentMerge pull request #57 from python-discord/dependabot/pip/furo-2022.4.7 (diff)
Move the creation of BotBase._guild_available to within the setup hook
This is to avoid a deprecation notice.
-rw-r--r--botcore/_bot.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/botcore/_bot.py b/botcore/_bot.py
index 6486670d..f9e0b9fb 100644
--- a/botcore/_bot.py
+++ b/botcore/_bot.py
@@ -74,7 +74,7 @@ class BotBase(commands.Bot):
self.statsd_url: Optional[str] = None
self._statsd_timerhandle: Optional[asyncio.TimerHandle] = None
- self._guild_available = asyncio.Event()
+ self._guild_available: Optional[asyncio.Event] = None
self.stats: Optional[AsyncStatsClient] = None
@@ -209,6 +209,8 @@ class BotBase(commands.Bot):
"""
loop = asyncio.get_running_loop()
+ self._guild_available = asyncio.Event()
+
self._resolver = aiohttp.AsyncResolver()
self._connector = aiohttp.TCPConnector(
resolver=self._resolver,