From 0591e442f1c9142a08f1150fbde2b5bc5c4bd607 Mon Sep 17 00:00:00 2001 From: Kaktushose <42280757+Kaktushose@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:41:25 +0100 Subject: [PATCH] fix required fields for TextInput [#155] --- .../commands/annotations/interactions/TextInput.java | 10 +++++----- .../definitions/interactions/ModalDefinition.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/jda-commands/src/main/java/com/github/kaktushose/jda/commands/annotations/interactions/TextInput.java b/jda-commands/src/main/java/com/github/kaktushose/jda/commands/annotations/interactions/TextInput.java index 156b597b..6d8da596 100644 --- a/jda-commands/src/main/java/com/github/kaktushose/jda/commands/annotations/interactions/TextInput.java +++ b/jda-commands/src/main/java/com/github/kaktushose/jda/commands/annotations/interactions/TextInput.java @@ -14,17 +14,17 @@ @Retention(RetentionPolicy.RUNTIME) public @interface TextInput { - /// The placeholder of this TextInput - /// - /// This is the short hint that describes the expected value of the TextInput field. + /// The label shown above this text input box. /// /// @return Placeholder String value(); - /// The label shown above this text input box + /// The placeholder of this TextInput. + /// + /// This is the short hint that describes the expected value of the TextInput field. /// /// @return Label for the input - String label() default ""; + String placeholder() default ""; /// The default value of this TextInput. /// diff --git a/jda-commands/src/main/java/com/github/kaktushose/jda/commands/definitions/interactions/ModalDefinition.java b/jda-commands/src/main/java/com/github/kaktushose/jda/commands/definitions/interactions/ModalDefinition.java index a6652cba..df956392 100644 --- a/jda-commands/src/main/java/com/github/kaktushose/jda/commands/definitions/interactions/ModalDefinition.java +++ b/jda-commands/src/main/java/com/github/kaktushose/jda/commands/definitions/interactions/ModalDefinition.java @@ -125,8 +125,8 @@ public static Optional build(ParameterDescription parameter var textInput = optional.get(); return Optional.of(new TextInputDefinition( - textInput.label().isEmpty() ? parameter.name() : textInput.label(), - textInput.value(), + textInput.value().isEmpty() ? parameter.name() : textInput.value(), + textInput.placeholder(), textInput.defaultValue(), textInput.minValue(), textInput.maxValue(),