Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clarity to clearly state that the ‘first’ audit log is the newest #1570

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jackfrojpg
Copy link

Please describe the changes this PR makes and why it should be merged:
This PR adds a small bit of extra text to make it clear to readers that the ‘first’ audit log is the most recent. Readers may be confused without this addition as they might believe that the first log is the first created, and therefore the oldest, however this isn’t the case and should be made clear.

@almostSouji
Copy link
Member

almostSouji commented Jul 16, 2024

This is an upstream (discord) implementation detail and not always the case, since:

The returned list of audit log entries is ordered based on whether you use before or after. When using before, the list is ordered by the audit log entry ID descending (newer entries first). If after is used, the list is reversed and appears in ascending order (older entries first). Omitting both before and after defaults to before the current timestamp and will show the most recent entries in descending order by ID, the opposite can be achieved using after=0 (showing oldest entries).

https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log

Yes, it is the case in the code sample we go through in this section, but since we only fetch 1, it's not that relevant in this context and could be interpreted as something that's always the case.

@jackfrojpg
Copy link
Author

jackfrojpg commented Jul 17, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants