diff --git a/ahtcg_bot.py b/ahtcg_bot.py index 3e245b7..cae66bf 100755 --- a/ahtcg_bot.py +++ b/ahtcg_bot.py @@ -30,6 +30,9 @@ class ArkhamDBUpdater(discord.Client): with open(self.channel_list_file) as f: self.channel_list = set(json.load(f)) + async def setup_hook(self) -> None: + self.arkhamdb_client = ArkhamDBClient() + async def close(self) -> None: await self.arkhamdb_client.close() await super().close() @@ -81,8 +84,6 @@ class ArkhamDBUpdater(discord.Client): await tree.sync() async def on_ready(self) -> None: - self.arkhamdb_client = ArkhamDBClient() - logging.info(f"Logged in as {self.user} (ID: {self.user.id})") expected_permissions = permissions = discord.Permissions( read_messages=True,