Skip to content

Commit

Permalink
Chage return type of method in JDA class. (#2504)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiLeo13 authored Jul 22, 2023
1 parent ec41b86 commit 5704d5f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/net/dv8tion/jda/api/JDA.java
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,9 @@ default PrivateChannel getPrivateChannelById(long id)
* <br>This will fail with {@link net.dv8tion.jda.api.requests.ErrorResponse#UNKNOWN_USER UNKNOWN_USER}
* if the user does not exist.
*
* <p>If the channel is cached, this will directly return the channel in a completed {@link RestAction} without making a request.
* You can use {@link CacheRestAction#useCache(boolean) action.useCache(false)} to force an update.
*
* <p><b>Example</b><br>
* <pre>{@code
* public void sendMessage(JDA jda, String userId, String content) {
Expand All @@ -1607,7 +1610,7 @@ default PrivateChannel getPrivateChannelById(long id)
*/
@Nonnull
@CheckReturnValue
default RestAction<PrivateChannel> openPrivateChannelById(@Nonnull String userId)
default CacheRestAction<PrivateChannel> openPrivateChannelById(@Nonnull String userId)
{
return openPrivateChannelById(MiscUtil.parseSnowflake(userId));
}
Expand Down

0 comments on commit 5704d5f

Please sign in to comment.