Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duck logs now respect private channels #617

Merged
merged 3 commits into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions techsupport_bot/extensions/duck.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,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(
Expand Down
Loading