discord-interactions.py

create_text_input

Function

Modal text field, short or paragraph.

from discord_interactions import create_text_input

Signature

def create_text_input(    custom_id: str,    label: str | None = None,    style: str | int = 1,    placeholder: str | None = None,    min_length: int | None = None,    max_length: int | None = None,    required: bool = True,    value: str | None = None,    component_id: int | None = None,) -> Dict[str, Any]

Parameters

NameTypeDefaultDescription
custom_idstrrequiredKey of the value in the submission.
labelstr | NoneNoneTitle in the legacy format (ActionRow). Removed automatically inside a Label.
stylestr | int1"short" / TextInputStyle.Short or "paragraph" / TextInputStyle.Paragraph.
placeholderstr | NoneNoneHint text (100 characters max).
min_lengthint | NoneNoneMinimum length (0 to 4000).
max_lengthint | NoneNoneMaximum length (1 to 4000).
requiredboolTrueField required.
valuestr | NoneNonePre-filled value.
component_idint | NoneNone

Returns

Dict[str, Any]

Type a name: create_button, ModalBuilder, cooldown.