aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Senjan21 <[email protected]>2021-04-15 18:44:49 +0200
committerGravatar Senjan21 <[email protected]>2021-04-15 18:44:49 +0200
commit7e74bb3608af5f1f96216db9472ccf5960c9124e (patch)
treefc59d89c667085d62876d9b296c22c6a164db1ca
parentChange typing, remove `range` alias (diff)
swap predicate save order for correct deletion
-rw-r--r--bot/exts/utils/clean.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/exts/utils/clean.py b/bot/exts/utils/clean.py
index 925d42483..e080f7caa 100644
--- a/bot/exts/utils/clean.py
+++ b/bot/exts/utils/clean.py
@@ -90,10 +90,6 @@ class Clean(Cog):
# Cleaning was canceled
return (message_mappings, message_ids)
- if predicate(message):
- message_mappings[message.channel].append(message)
- message_ids.append(message.id)
-
if until_message:
# We could use ID's here however in case if the message we are looking for gets deleted,
@@ -102,6 +98,10 @@ class Clean(Cog):
# Means we have found the message until which we were supposed to be deleting.
break
+ if predicate(message):
+ message_mappings[message.channel].append(message)
+ message_ids.append(message.id)
+
return message_mappings, message_ids
async def _clean_messages(