mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 10:49:24 +00:00
Fix Client.logs_from failing if no more messages are found.
This commit is contained in:
parent
434fc5c79e
commit
f78e3c9f0b
@ -1110,9 +1110,12 @@ class Client:
|
||||
while limit > 0:
|
||||
retrieve = limit if limit <= 100 else 100
|
||||
data = yield from self._logs_from(channel, retrieve, before, after)
|
||||
limit -= retrieve
|
||||
result.extend(data)
|
||||
before = Object(id=data[-1]['id'])
|
||||
if len(data):
|
||||
limit -= retrieve
|
||||
result.extend(data)
|
||||
before = Object(id=data[-1]['id'])
|
||||
else:
|
||||
break
|
||||
|
||||
return generator(result)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user