diff options
| -rw-r--r-- | bot/bot.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bot/bot.py b/bot/bot.py index e1b1d81dc..9f48c980c 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -37,8 +37,14 @@ class Bot(commands.Bot): log.info(f"Cog loaded: {cog.qualified_name}") def clear(self) -> None: - """Clears the internal state of the bot and sets the HTTPClient connector to None.""" - self.http.connector = None # Use the default connector. + """ + Clears the internal state of the bot and recreates the connector and sessions. + + Will cause a DeprecationWarning if called outside a coroutine. + """ + # Because discord.py recreates the HTTPClient session, may as well follow suite and recreate + # our own stuff here too. + self._recreate() super().clear() async def close(self) -> None: |