diff --git a/src/main/java/net/dv8tion/jda/internal/requests/restaction/interactions/AutoCompleteCallbackActionImpl.java b/src/main/java/net/dv8tion/jda/internal/requests/restaction/interactions/AutoCompleteCallbackActionImpl.java index d7a4fd255f..755cf65d8d 100644 --- a/src/main/java/net/dv8tion/jda/internal/requests/restaction/interactions/AutoCompleteCallbackActionImpl.java +++ b/src/main/java/net/dv8tion/jda/internal/requests/restaction/interactions/AutoCompleteCallbackActionImpl.java @@ -69,10 +69,10 @@ public AutoCompleteCallbackAction addChoices(@Nonnull Collection "Choice of type %s cannot be converted to INTEGER", choice.getType()); long valueLong = choice.getAsLong(); Checks.check(valueLong <= OptionData.MAX_POSITIVE_NUMBER, - "Choice value cannot be larger than %d Provided: %d", + "Choice value cannot be larger than %f Provided: %d", OptionData.MAX_POSITIVE_NUMBER, valueLong); Checks.check(valueLong >= OptionData.MIN_NEGATIVE_NUMBER, - "Choice value cannot be smaller than %d. Provided: %d", + "Choice value cannot be smaller than %f. Provided: %d", OptionData.MIN_NEGATIVE_NUMBER, valueLong); break; case NUMBER: @@ -80,10 +80,10 @@ public AutoCompleteCallbackAction addChoices(@Nonnull Collection "Choice of type %s cannot be converted to NUMBER", choice.getType()); double valueDouble = choice.getAsDouble(); Checks.check(valueDouble <= OptionData.MAX_POSITIVE_NUMBER, - "Choice value cannot be larger than %d Provided: %d", + "Choice value cannot be larger than %f Provided: %f", OptionData.MAX_POSITIVE_NUMBER, valueDouble); Checks.check(valueDouble >= OptionData.MIN_NEGATIVE_NUMBER, - "Choice value cannot be smaller than %d. Provided: %d", + "Choice value cannot be smaller than %f. Provided: %f", OptionData.MIN_NEGATIVE_NUMBER, valueDouble); break; case STRING: diff --git a/src/main/java/net/dv8tion/jda/internal/utils/Checks.java b/src/main/java/net/dv8tion/jda/internal/utils/Checks.java index 4ce2bee3d8..5e913595b8 100644 --- a/src/main/java/net/dv8tion/jda/internal/utils/Checks.java +++ b/src/main/java/net/dv8tion/jda/internal/utils/Checks.java @@ -25,6 +25,7 @@ import net.dv8tion.jda.api.interactions.components.ActionComponent; import net.dv8tion.jda.api.interactions.components.Component; import net.dv8tion.jda.api.interactions.components.LayoutComponent; +import org.intellij.lang.annotations.PrintFormat; import org.jetbrains.annotations.Contract; import java.util.*; @@ -63,14 +64,14 @@ public static void check(final boolean expression, final String message) } @Contract("false, _, _ -> fail") - public static void check(final boolean expression, final String message, final Object... args) + public static void check(final boolean expression, @PrintFormat final String message, final Object... args) { if (!expression) throw new IllegalArgumentException(String.format(message, args)); } @Contract("false, _, _ -> fail") - public static void check(final boolean expression, final String message, final Object arg) + public static void check(final boolean expression, @PrintFormat final String message, final Object arg) { if (!expression) throw new IllegalArgumentException(String.format(message, arg));