From 8ee3ac9352724c64c76763b03a1e74cc427c4235 Mon Sep 17 00:00:00 2001 From: Kreusada <67752638+Kreusada@users.noreply.github.com> Date: Thu, 29 Jun 2023 05:06:44 +0100 Subject: [PATCH] [Cleanup] Fix `[p]cleanup self` inside DMs (#6197) --- redbot/cogs/cleanup/cleanup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redbot/cogs/cleanup/cleanup.py b/redbot/cogs/cleanup/cleanup.py index 5d148d48d..bd3095f24 100644 --- a/redbot/cogs/cleanup/cleanup.py +++ b/redbot/cogs/cleanup/cleanup.py @@ -148,7 +148,7 @@ class Cleanup(commands.Cog): """ Sends a notification to the channel that a certain number of messages have been deleted. """ - if not hasattr(channel, "guild") or await self.config.guild(channel.guild).notify(): + if not channel.guild or await self.config.guild(channel.guild).notify(): if subtract_invoking: num -= 1 if num == 1: