From 8e86da4abf05b1441b89aa330b3f3e05d8c0dd72 Mon Sep 17 00:00:00 2001 From: Conatum Date: Tue, 28 Sep 2021 09:07:03 +0300 Subject: [PATCH] fix (video): Don't pre-load with no channels. --- bot/modules/moderation/video/admin.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bot/modules/moderation/video/admin.py b/bot/modules/moderation/video/admin.py index e5be87b0..fd75573b 100644 --- a/bot/modules/moderation/video/admin.py +++ b/bot/modules/moderation/video/admin.py @@ -55,13 +55,14 @@ class video_channels(settings.ChannelList, settings.ListData, settings.Setting): for guild in client.guilds if any(channel.members for channel in guild.voice_channels) ] - rows = cls._table_interface.select_where( - guildid=active_guildids - ) - cache = defaultdict(list) - for row in rows: - cache[row['guildid']].append(row['channelid']) - cls._cache.update(cache) + if active_guildids: + rows = cls._table_interface.select_where( + guildid=active_guildids + ) + cache = defaultdict(list) + for row in rows: + cache[row['guildid']].append(row['channelid']) + cls._cache.update(cache) @GuildSettings.attach_setting