diff options
| author | 2019-12-14 11:36:37 +0100 | |
|---|---|---|
| committer | 2019-12-14 11:36:37 +0100 | |
| commit | b2a5ab90622e986ace37be6204d6a59823390cce (patch) | |
| tree | 16f39da7592b7273038fbf821d84d6e15a025b7e | |
| parent | Rename config entry to offensive_msg_delete_days (diff) | |
Catch all HTTPExecption
| -rw-r--r-- | bot/cogs/filtering.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py index c0e115a8f..c0a2c7d3b 100644 --- a/bot/cogs/filtering.py +++ b/bot/cogs/filtering.py @@ -7,7 +7,7 @@ from typing import Mapping, Optional, Union import dateutil import discord.errors from dateutil.relativedelta import relativedelta -from discord import Colour, DMChannel, Member, Message, NotFound, TextChannel +from discord import Colour, DMChannel, HTTPException, Member, Message, NotFound, TextChannel from discord.ext.commands import Cog from bot.bot import Bot @@ -439,6 +439,10 @@ class Filtering(Cog, Scheduler): f"Tried to delete message {msg['id']}, but the message can't be found " f"(it has been probably already deleted)." ) + except HTTPException: + log.warning( + f"Failed to delete message {msg['id']}." + ) await self.bot.api_client.delete(f'bot/offensive-message/{msg["id"]}') log.info(f"Deleted the offensive message with id {msg['id']}.") |