aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-08-04 12:36:14 -0700
committerGravatar MarkKoz <[email protected]>2020-08-04 12:43:02 -0700
commit9b9a4390111c1a87e0fff87eae134a0745c26345 (patch)
treed1582c90a26544c974f2b6ba69bbeeca758bc6b0
parentHelpChannels: move unpinning to separate function (diff)
HelpChannels: add more detail to unpin log messages
-rw-r--r--bot/cogs/help_channels.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py
index 61e8d4384..e281615c2 100644
--- a/bot/cogs/help_channels.py
+++ b/bot/cogs/help_channels.py
@@ -855,17 +855,21 @@ class HelpChannels(commands.Cog):
async def unpin(self, channel: discord.TextChannel) -> None:
"""Unpin the initial question message sent in `channel`."""
+ channel_str = f"#{channel} ({channel.id})"
+
msg_id = await self.question_messages.pop(channel.id)
try:
await self.bot.http.unpin_message(channel.id, msg_id)
except discord.HTTPException as e:
if e.code == 10008:
- log.trace(f"Message {msg_id} don't exist, can't unpin.")
+ log.debug(f"Message {msg_id} in {channel_str} doesn't exist; can't unpin.")
else:
- log.warn(f"Got unexpected status {e.code} when unpinning message {msg_id}: {e.text}")
+ log.exception(
+ f"Error unpinning message {msg_id} in {channel_str}: {e.status} ({e.code})"
+ )
else:
- log.trace(f"Unpinned message {msg_id}.")
+ log.trace(f"Unpinned message {msg_id} in {channel_str}.")
async def wait_for_dormant_channel(self) -> discord.TextChannel:
"""Wait for a dormant channel to become available in the queue and return it."""