#[non_exhaustive]pub struct InputText {
pub kind: ComponentType,
pub custom_id: String,
pub style: Option<InputTextStyle>,
pub label: Option<String>,
pub min_length: Option<u16>,
pub max_length: Option<u16>,
pub required: bool,
pub value: Option<String>,
pub placeholder: Option<String>,
}
Expand description
An input text component for modal interactions
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: ComponentType
The component type, it will always be ComponentType::InputText
.
custom_id: String
Developer-defined identifier for the input; max 100 characters
style: Option<InputTextStyle>
The InputTextStyle
. Required when sending modal data.
Discord docs are wrong here; it says the field is always sent in modal submit interactions but it’s not. It’s only required when sending modal data to Discord. https://github.com/discord/discord-api-docs/issues/6141
label: Option<String>
Label for this component; max 45 characters. Required when sending modal data.
Discord docs are wrong here; it says the field is always sent in modal submit interactions but it’s not. It’s only required when sending modal data to Discord. https://github.com/discord/discord-api-docs/issues/6141
min_length: Option<u16>
Minimum input length for a text input; min 0, max 4000
max_length: Option<u16>
Maximum input length for a text input; min 1, max 4000
required: bool
Whether this component is required to be filled (defaults to true)
value: Option<String>
When sending: Pre-filled value for this component; max 4000 characters (may be None).
When receiving: The input from the user (always Some)
placeholder: Option<String>
Custom placeholder text if the input is empty; max 100 characters