From 4743d14e35fa1040018741da5d916f11b138e716 Mon Sep 17 00:00:00 2001 From: BreadTube Date: Wed, 27 May 2026 01:18:28 +0900 Subject: [PATCH] Fix channel deletion tracking --- breadtube_bot/bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/breadtube_bot/bot.py b/breadtube_bot/bot.py index dc652e5..b7d1ba2 100644 --- a/breadtube_bot/bot.py +++ b/breadtube_bot/bot.py @@ -141,7 +141,7 @@ class Bot: self.logger.debug('Deleting duplicated text channels') channel_names: list[str] = [c.name for c in self.guild_text_channels if c.name is not None] unique_names: set[str] = set(channel_names) - deleted_channels: set[TextChannel] = set() + deleted_channels: list[TextChannel] = [] try: for name in unique_names: occurence = 0 @@ -152,7 +152,7 @@ class Bot: self.logger.debug('Deleting duplicate channel: %d -> %s', channel.id, name) self.discord_manager.delete_text_channel( channel.id, request_timeout=self.config.request_timeout) - deleted_channels.add(channel) + deleted_channels.append(channel) finally: self.guild_text_channels = [c for c in self.guild_text_channels if c not in deleted_channels] @@ -228,13 +228,13 @@ class Bot: def _clean_category(self, category: ChannelCategory): self.logger.info('Cleaning category "%s" (%d)', category.name, category.id) - deleted_channels: set[TextChannel] = set() + deleted_channels: list[TextChannel] = [] try: for channel in self.guild_text_channels: if channel.parent_id == category.id: self.logger.debug('Cleaning category -> deleting channel "%s"', channel.name) self.discord_manager.delete_text_channel(channel.id, request_timeout=self.config.request_timeout) - deleted_channels.add(channel) + deleted_channels.append(channel) finally: self.guild_text_channels = [c for c in self.guild_text_channels if c not in deleted_channels]