Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an assignment statement to setter #980

Merged
merged 1 commit into from
Feb 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions discord/ui/input_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def label(self) -> str:
def label(self, value: str):
if not isinstance(value, str):
raise TypeError(f"label should be None or str not {value.__class__}")
self._underlying.label = value

@property
def placeholder(self) -> Optional[str]:
Expand Down Expand Up @@ -151,6 +152,7 @@ def required(self) -> Optional[bool]:
def required(self, value: Optional[bool]):
if not isinstance(value, bool):
raise TypeError(f"required must be bool not {value.__class__}") # type: ignore
self._underlying.required = bool(value)

@property
def value(self) -> Optional[str]:
Expand Down