aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/moderation/incidents.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/exts/moderation/incidents.py b/bot/exts/moderation/incidents.py
index 5d2c66d6c..14bec3877 100644
--- a/bot/exts/moderation/incidents.py
+++ b/bot/exts/moderation/incidents.py
@@ -175,7 +175,12 @@ async def make_message_link_embed(ctx: Context, message_link: str) -> t.Optional
try:
message: discord.Message = await MessageConverter().convert(ctx, message_link)
except MessageNotFound:
- mod_logs_channel = ctx.bot.get_channel(Channels.mod_log)
+ try:
+ mod_logs_channel = ctx.bot.get_channel(Channels.mod_log)
+ except discord.NotFound:
+ log.exception(f"Mod-logs (<#{Channels.mod_log}> channel not found.")
+ return
+
last_100_logs: list[discord.Message] = await mod_logs_channel.history(limit=100).flatten()
for log_entry in last_100_logs: