From a197c8bb9c13dba4c9609bf1135a800da4c42b25 Mon Sep 17 00:00:00 2001 From: James Gayfer Date: Mon, 30 Oct 2017 18:41:10 -0700 Subject: [PATCH] add permission check to deleting spam messages --- cogs/utils/messages.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cogs/utils/messages.py b/cogs/utils/messages.py index 36321cc..ff7b7ec 100644 --- a/cogs/utils/messages.py +++ b/cogs/utils/messages.py @@ -113,4 +113,7 @@ def check(message): if cleanup: await asyncio.sleep(constants.SPAM_DELAY) - await self.channel.purge(limit=999, check=check) + try: + await self.channel.purge(limit=999, check=check) + except: + pass