From 52c45da0bca7585d12718c04dccd4985292682e1 Mon Sep 17 00:00:00 2001 From: khazhyk Date: Sun, 7 Apr 2019 22:24:21 -0700 Subject: 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 --- discord/guild.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'discord/guild.py') 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| -- cgit v1.2.3