From 71e23ec4c0a27dfc34fba3a9eb5f6fe61e73d20c Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 20 Apr 2024 20:03:42 -0400 Subject: [PATCH] Don't try to track non-existant channels --- ahtcg_bot.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ahtcg_bot.py b/ahtcg_bot.py index c3d8693..2d09144 100755 --- a/ahtcg_bot.py +++ b/ahtcg_bot.py @@ -101,8 +101,14 @@ class ArkhamDBUpdater(discord.Client): logging.info(f" - {guild.name}") logging.info("------") - for channel_id in self.channel_list: + for channel_id in list(self.channel_list): channel = self.get_channel(channel_id) + if channel is None: + print( + f"channel {channel_id} does not exist, removing it from tracking!" + ) + self.channel_list.remove(channel_id) + continue permissions = channel.permissions_for(channel.guild.me) missing_permissions = ( permissions & expected_permissions