From 03084d30057490d17d8a4f414fc2fe5819cd05cb Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Wed, 23 Aug 2023 11:44:35 -0400 Subject: [PATCH] Duck logs now respect private channels --- techsupport_bot/extensions/duck.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/techsupport_bot/extensions/duck.py b/techsupport_bot/extensions/duck.py index 3db32f47..c3913af0 100644 --- a/techsupport_bot/extensions/duck.py +++ b/techsupport_bot/extensions/duck.py @@ -180,13 +180,15 @@ async def handle_winner(self, winner, guild, action, raw_duration, channel): raw_duration -> A datetime object of the time since the duck spawned channel -> The channel in which the duck game happened in """ - await self.bot.guild_log( - guild, - "logging_channel", - "info", - f"Duck {action} by {winner} in #{channel.name}", - send=True, - ) + config_ = await self.bot.get_context_config(guild=guild) + if not str(channel.id) in config_.get("private_channels", []): + await self.bot.guild_log( + guild, + "logging_channel", + "info", + f"Duck {action} by {winner} in #{channel.name}", + send=True, + ) duration_seconds = raw_duration.seconds duration_exact = float(