mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[V3] Fix Cleanup loop (#1533)
* prevent infinite loop * pep8 updates Assorted pep8 updates to retrigger Travis * Revert "pep8 updates" This reverts commit d0c7f8b8089774f5108e5eb6db385aacb1df7ecb.
This commit is contained in:
parent
7499f5dbfa
commit
fb8e4430ac
@ -55,6 +55,7 @@ class Cleanup:
|
||||
too_old = False
|
||||
|
||||
while not too_old and len(to_delete) - 1 < number:
|
||||
message = None
|
||||
async for message in channel.history(limit=limit,
|
||||
before=before,
|
||||
after=after):
|
||||
@ -66,6 +67,9 @@ class Cleanup:
|
||||
break
|
||||
elif number and len(to_delete) >= number:
|
||||
break
|
||||
if message is None:
|
||||
break
|
||||
else:
|
||||
before = message
|
||||
return to_delete
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user