From 4e1ce7524b46b94855d9fdb2444d56f7b2caf9ec Mon Sep 17 00:00:00 2001 From: Dav Date: Sat, 19 Sep 2020 19:39:59 +0200 Subject: [PATCH] [Modlog API] Handle deleted channels in `Case.message_content()` (#4415) * Handle deleted channels in case.message_content() * remove avatar_url + black --- redbot/core/modlog.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/redbot/core/modlog.py b/redbot/core/modlog.py index aa7195021..77c6aed4f 100644 --- a/redbot/core/modlog.py +++ b/redbot/core/modlog.py @@ -434,7 +434,10 @@ class Case: if until and duration: case_text += _("**Until:** {}\n**Duration:** {}\n").format(until, duration) if self.channel: - case_text += _("**Channel**: {}\n").format(self.channel.name) + if isinstance(self.channel, int): + case_text += _("**Channel**: {} (Deleted)\n").format(self.channel) + else: + case_text += _("**Channel**: {}\n").format(self.channel.name) if amended_by: case_text += _("**Amended by:** {}\n").format(amended_by) if last_modified: