mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 18:59:09 +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:
|
while limit > 0:
|
||||||
retrieve = limit if limit <= 100 else 100
|
retrieve = limit if limit <= 100 else 100
|
||||||
data = yield from self._logs_from(channel, retrieve, before, after)
|
data = yield from self._logs_from(channel, retrieve, before, after)
|
||||||
|
if len(data):
|
||||||
limit -= retrieve
|
limit -= retrieve
|
||||||
result.extend(data)
|
result.extend(data)
|
||||||
before = Object(id=data[-1]['id'])
|
before = Object(id=data[-1]['id'])
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
return generator(result)
|
return generator(result)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user