Skip to content

Conversation

Copy link

Copilot AI commented Oct 31, 2025

The javadoc for getHistoryBefore methods incorrectly stated that messages are retrieved "after" the marker instead of "before", and contained an example using the wrong method name.

Fixed documentation:

  • getHistoryBefore(String messageId, int limit) - @param limit now correctly states "before the marker"
  • getHistoryBefore(long messageId, int limit) - @param limit now correctly states "before the marker"
  • getHistoryBefore(Message message, int limit) - @param limit now correctly states "before the marker"
  • getHistoryBefore(Message message, int limit) - example code changed from getHistoryAfter(message, 100) to getHistoryBefore(message, 100)

Example of fixed documentation:

/**
 * @param  limit
 *         The amount of messages to be retrieved before the marker. Minimum: 1, Max: 100.
 */
default MessageHistory.MessageRetrieveAction getHistoryBefore(@Nonnull String messageId, int limit)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.oracle.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/javadoc @/home/REDACTED/work/JDA/JDA/build/tmp/javadoc/javadoc.options (dns block)
  • takahikokawasaki.github.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/javadoc @/home/REDACTED/work/JDA/JDA/build/tmp/javadoc/javadoc.options (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Wrong documentation on MessageChannel history getter methods</issue_title>
<issue_description>### General Troubleshooting

  • I have checked for similar issues on the Issue-tracker.
  • I have checked for PRs that might already address this issue.

Version of JDA

6.1.0

Expected Behaviour

Documentation of getHistoryBefore methods sometimes mention messages after the marker, while it should say before the marker. It also mentions getHistoryBefore in examples, which should be getHistoryAfter

A patch is available at: e8dae00

Code Example for Reproduction Steps

N/A

Code for JDABuilder or DefaultShardManagerBuilder used

N/A

Exception or Error

N/A
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Fixed @param limit documentation in getHistoryBefore(String messageId, int limit) to say "before" instead of "after"
- Fixed @param limit documentation in getHistoryBefore(long messageId, int limit) to say "before" instead of "after"
- Fixed example code in getHistoryBefore(Message message, int limit) to use getHistoryBefore instead of getHistoryAfter
- Fixed @param limit documentation in getHistoryBefore(Message message, int limit) to say "before" instead of "after"

Co-authored-by: MinnDevelopment <[email protected]>
Copilot AI changed the title [WIP] Fix documentation inaccuracies for MessageChannel history getter methods Fix incorrect documentation in MessageChannel.getHistoryBefore methods Oct 31, 2025
Copilot AI requested a review from MinnDevelopment October 31, 2025 19:24
Copilot finished work on behalf of MinnDevelopment October 31, 2025 19:24
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.

Wrong documentation on MessageChannel history getter methods

2 participants