Skip to content

Commit

Permalink
Two random things that date back to times older than d.py 1.1...
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed Jan 13, 2021
1 parent d91ff8f commit 8b0c337
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion redbot/core/commands/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ async def send_interactive(
else:
try:
await self.channel.delete_messages((query, resp))
except (discord.HTTPException, AttributeError):
except discord.HTTPException:
# In case the bot can't delete other users' messages,
# or is not a bot account
# or channel is a DM
Expand Down
8 changes: 2 additions & 6 deletions redbot/core/modlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,11 @@ async def from_json(
if message is None:
message_id = data.get("message")
if message_id is not None:
try:
message = discord.utils.get(bot.cached_messages, id=message_id)
except AttributeError:
# bot.cached_messages didn't exist prior to discord.py 1.1.0
message = None
message = discord.utils.get(bot.cached_messages, id=message_id)
if message is None:
try:
message = await mod_channel.fetch_message(message_id)
except (discord.HTTPException, AttributeError):
except discord.HTTPException:
message = None
else:
message = None
Expand Down

0 comments on commit 8b0c337

Please sign in to comment.