[Modlog API] Handle deleted channels in Case.message_content() (#4415)

* Handle deleted channels in case.message_content()

* remove avatar_url + black
This commit is contained in:
Dav 2020-09-19 19:39:59 +02:00 committed by GitHub
parent fec25fcaba
commit 4e1ce7524b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -434,7 +434,10 @@ class Case:
if until and duration: if until and duration:
case_text += _("**Until:** {}\n**Duration:** {}\n").format(until, duration) case_text += _("**Until:** {}\n**Duration:** {}\n").format(until, duration)
if self.channel: 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: if amended_by:
case_text += _("**Amended by:** {}\n").format(amended_by) case_text += _("**Amended by:** {}\n").format(amended_by)
if last_modified: if last_modified: