From c78ee14617b1f538d22375d01fb27e2e43be61e9 Mon Sep 17 00:00:00 2001 From: kingslayer268 <36760455+kingslayer268@users.noreply.github.com> Date: Sat, 6 Mar 2021 20:51:25 +0530 Subject: [PATCH] Fix `AttributeError` in `Context.delete_messages()` (#4876) delete_messages() isn't an attribute of DMChannels --- redbot/core/commands/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redbot/core/commands/context.py b/redbot/core/commands/context.py index a5cd89302..a2dab2495 100644 --- a/redbot/core/commands/context.py +++ b/redbot/core/commands/context.py @@ -188,7 +188,7 @@ class Context(DPYContext): else: try: await self.channel.delete_messages((query, resp)) - except discord.HTTPException: + except (discord.HTTPException, AttributeError): # In case the bot can't delete other users' messages, # or is not a bot account # or channel is a DM