Skip to content

Commit

Permalink
chore: Add @CheckReturnValue to action-returning methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparky983 committed Apr 9, 2024
1 parent 3980fb2 commit 7be8b65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion;
import net.dv8tion.jda.api.requests.restaction.interactions.ReplyCallbackAction;
import net.dv8tion.jda.api.utils.messages.MessageCreateData;
import org.jetbrains.annotations.CheckReturnValue;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -74,6 +75,7 @@ public interface SlashSender {
* @param message The message to reply with.
* @return The reply action.
*/
@CheckReturnValue
@NotNull ReplyCallbackAction reply(final @NotNull String message);

/**
Expand All @@ -82,6 +84,7 @@ public interface SlashSender {
* @param message The message to reply with.
* @return The reply action.
*/
@CheckReturnValue
@NotNull ReplyCallbackAction reply(final @NotNull MessageCreateData message);

/**
Expand All @@ -91,6 +94,7 @@ public interface SlashSender {
* @param embeds The additional embeds.
* @return The reply action.
*/
@CheckReturnValue
@NotNull ReplyCallbackAction reply(final @NotNull MessageEmbed embed, final @NotNull MessageEmbed @NotNull ... embeds);

/**
Expand All @@ -99,13 +103,15 @@ public interface SlashSender {
* @param embeds The embeds to reply with.
* @return The reply action.
*/
@CheckReturnValue
@NotNull ReplyCallbackAction reply(final @NotNull Collection<? extends MessageEmbed> embeds);

/**
* Defers the reply to the command.
*
* @return The reply action.
*/
@CheckReturnValue
@NotNull ReplyCallbackAction deferReply();

/**
Expand All @@ -114,5 +120,6 @@ public interface SlashSender {
* @param ephemeral Whether the message should be ephemeral.
* @return The reply action.
*/
@CheckReturnValue
@NotNull ReplyCallbackAction deferReply(final boolean ephemeral);
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "0.16.1"

# Core
guava = "31.1-jre"
annotations = "23.0.0"
annotations = "24.1.0"

# Testing
junit = "5.9.1"
Expand Down

0 comments on commit 7be8b65

Please sign in to comment.