Skip to content

Commit

Permalink
Merge pull request Pycord-Development#1091 from krittick/input-text-l…
Browse files Browse the repository at this point in the history
…abel-fix

Fix for `InputText.label` being required
  • Loading branch information
krittick authored Feb 27, 2022
2 parents 6a7d311 + 66a981e commit 7a1e889
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions discord/ui/input_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class InputText:
The style of the input text field.
custom_id: Optional[:class:`str`]
The ID of the input text field that gets received during an interaction.
label: Optional[:class:`str`]
The label for the input text field, if any.
label: :class:`str`
The label for the input text field.
Must be 45 characters or fewer.
placeholder: Optional[:class:`str`]
The placeholder text that is shown if nothing is selected, if any.
Expand All @@ -40,7 +40,7 @@ class InputText:
Pre-fills the input text field with this value.
Must be 4000 characters or fewer.
row: Optional[:class:`int`]
The relative row this button belongs to. A Discord component can only have 5
The relative row this input text field belongs to. A modal dialog can only have 5
rows. By default, items are arranged automatically into those 5 rows. If you'd
like to control the relative positioning of the row then passing an index is advised.
For example, row=1 will show up before row=2. Defaults to ``None``, which is automatic
Expand All @@ -52,7 +52,7 @@ def __init__(
*,
style: InputTextStyle = InputTextStyle.short,
custom_id: str = MISSING,
label: Optional[str] = None,
label: str,
placeholder: Optional[str] = None,
min_length: Optional[int] = None,
max_length: Optional[int] = None,
Expand Down Expand Up @@ -114,7 +114,7 @@ def label(self) -> str:
@label.setter
def label(self, value: str):
if not isinstance(value, str):
raise TypeError(f"label should be None or str not {value.__class__}")
raise TypeError(f"label should be str not {value.__class__}")
self._underlying.label = value

@property
Expand Down

0 comments on commit 7a1e889

Please sign in to comment.