diff --git a/redbot/core/modlog.py b/redbot/core/modlog.py index 6e2e4f10a..e2cdaefa9 100644 --- a/redbot/core/modlog.py +++ b/redbot/core/modlog.py @@ -374,8 +374,19 @@ class Case: except discord.Forbidden: log.info( "Modlog failed to edit the Discord message for" - " the case #%s from guild with ID due to missing permissions." + " the case #%s from guild with ID %s due to missing permissions.", + self.case_number, + self.guild.id, ) + except discord.NotFound: + log.info( + "Modlog failed to edit the Discord message for" + " the case #%s from guild with ID %s as it no longer exists." + " Clearing the message ID from case data...", + self.case_number, + self.guild.id, + ) + await self.edit({"message": None}) except Exception: # `finally` with `return` suppresses unexpected exceptions log.exception( "Modlog failed to edit the Discord message for"