aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/help_channels/_message.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/bot/exts/help_channels/_message.py b/bot/exts/help_channels/_message.py
index 8eb4ec311..128fa847b 100644
--- a/bot/exts/help_channels/_message.py
+++ b/bot/exts/help_channels/_message.py
@@ -66,12 +66,11 @@ async def get_last_message(channel: discord.TextChannel) -> t.Optional[discord.M
"""Return the last message sent in the channel or None if no messages exist."""
log.trace(f"Getting the last message in #{channel} ({channel.id}).")
- try:
- async for message in channel.history(limit=1):
- return message
- except StopAsyncIteration:
- log.debug(f"No last message available; #{channel} ({channel.id}) has no messages.")
- return None
+ async for message in channel.history(limit=1):
+ return message
+
+ log.debug(f"No last message available; #{channel} ({channel.id}) has no messages.")
+ return None
async def is_empty(channel: discord.TextChannel) -> bool: