diff options
| author | khazhyk <[email protected]> | 2019-04-07 22:24:21 -0700 |
|---|---|---|
| committer | khazhyk <[email protected]> | 2019-04-07 22:46:41 -0700 |
| commit | 52c45da0bca7585d12718c04dccd4985292682e1 (patch) | |
| tree | 931a91ac17b5ac6bf6376b74523f32bdf37b2a82 /discord/guild.py | |
| parent | simplify HistoryIterator message ordering (diff) | |
| download | discord.py-52c45da0bca7585d12718c04dccd4985292682e1.tar.xz discord.py-52c45da0bca7585d12718c04dccd4985292682e1.zip | |
simplify AuditLogIterator ordering
rename reverse to oldest_first and remove cases where messages would
be ordered differently from the order we fetch audit log entries,
similar to HistoryIterator
Diffstat (limited to 'discord/guild.py')
| -rw-r--r-- | discord/guild.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/discord/guild.py b/discord/guild.py index d0d6daa8..725a51d3 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1437,7 +1437,7 @@ class Guild(Hashable): raise ClientException('Must not be a bot account to ack messages.') return state.http.ack_guild(self.id) - def audit_logs(self, *, limit=100, before=None, after=None, reverse=None, user=None, action=None): + def audit_logs(self, *, limit=100, before=None, after=None, oldest_first=None, user=None, action=None): """Return an :class:`AsyncIterator` that enables receiving the guild's audit logs. You must have the :attr:`~Permissions.view_audit_log` permission to use this. @@ -1470,11 +1470,9 @@ class Guild(Hashable): after: Union[:class:`abc.Snowflake`, datetime] Retrieve entries after this date or entry. If a date is provided it must be a timezone-naive datetime representing UTC time. - reverse: :class:`bool` - If set to true, return entries in oldest->newest order. If unspecified, - this defaults to ``False`` for most cases. However if passing in a - ``after`` parameter then this is set to ``True``. This avoids getting entries - out of order in the ``after`` case. + oldest_first: :class:`bool` + If set to true, return entries in oldest->newest order. Defaults to True if + ``after`` is specified, otherwise False. user: :class:`abc.Snowflake` The moderator to filter entries from. action: :class:`AuditLogAction` @@ -1499,7 +1497,7 @@ class Guild(Hashable): action = action.value return AuditLogIterator(self, before=before, after=after, limit=limit, - reverse=reverse, user_id=user, action_type=action) + oldest_first=oldest_first, user_id=user, action_type=action) async def widget(self): """|coro| |