Annotation Interface TextInput


@Target(PARAMETER) @Retention(RUNTIME) public @interface TextInput
Annotation used to add TextInputs to Modals.
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The label shown above this text input box.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The default value of this TextInput.
    int
    The maximum length.
    int
    The minimum length.
    The placeholder of this TextInput.
    boolean
    Whether this TextInput is required.
    net.dv8tion.jda.api.interactions.components.text.TextInputStyle
    The TextInputStyle.
  • Element Details

    • value

      String value
      The label shown above this text input box.
      Returns:
      Placeholder
    • placeholder

      String placeholder

      The placeholder of this TextInput.

      This is the short hint that describes the expected value of the TextInput field.

      Returns:
      Label for the input
      Default:
      ""
    • defaultValue

      String defaultValue

      The default value of this TextInput.

      This sets a pre-populated text for this TextInput field

      Returns:
      default value
      Default:
      ""
    • minValue

      int minValue
      The minimum length. This is -1 if none has been set.
      Returns:
      Minimum length or -1
      Default:
      -1
    • maxValue

      int maxValue
      The maximum length. This is -1 if none has been set.
      Returns:
      Maximum length or -1
      Default:
      -1
    • style

      net.dv8tion.jda.api.interactions.components.text.TextInputStyle style
      The TextInputStyle. The default value is TextInputStyle.PARAGRAPH.
      Returns:
      The TextInputStyle
      Default:
      PARAGRAPH
    • required

      boolean required

      Whether this TextInput is required.

      If this is True, the user must populate this TextInput field before they can submit the Modal.

      Returns:
      True if this TextInput is required
      See Also:
      • TextInput.isRequired()
      Default:
      true