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

Chage return type of method in JDA class. #2504

Merged
merged 1 commit into from
Jul 22, 2023
Merged

Chage return type of method in JDA class. #2504

merged 1 commit into from
Jul 22, 2023

Conversation

kiLeo13
Copy link
Contributor

@kiLeo13 kiLeo13 commented Jul 22, 2023

  • Changed the return type of "openPrivateChannelById(String)" from RestAction to CacheRestAction as it delegates to a method that returns CacheRestAction.

Pull Request Etiquette

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Closes Issue: NaN

Description

The return type of JDA#openPrivateChannelById(long) is CacheRestAction. However, the method JDA#openPrivateChannelById(String) returns RestAction, implying that the cache will not be used. This seems inconsistent, especially considering that the String method delegates to the long method.

Also changed the documentation of JDA#openPrivateChannelById(String) to clarify that the cache will be used.

* Changed the return type of "openPrivateChannelById(String)" from RestAction to CacheRestAction as it delegates to a method that returns CacheRestAction.
@Xirado
Copy link
Contributor

Xirado commented Jul 22, 2023

Dev-facing methods should not expose internal RestAction implementations, but rather the common RestAction interface.

@MinnDevelopment MinnDevelopment merged commit 5704d5f into discord-jda:master Jul 22, 2023
1 check passed
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.

3 participants