Skip to content

Commit

Permalink
update setter logic with real math
Browse files Browse the repository at this point in the history
  • Loading branch information
krittick committed Apr 17, 2022
1 parent 4768663 commit 96b3859
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/ui/input_text.py
Expand Up @@ -153,7 +153,7 @@ def min_length(self) -> Optional[int]:
def min_length(self, value: Optional[int]):
if value and not isinstance(value, int):
raise TypeError(f"min_length must be None or int not {value.__class__.__name__}") # type: ignore
if 0 <= value <= 4000:
if value < 0 or value > 4000:
raise ValueError("min_length must be between 0 and 4000")
self._underlying.min_length = value

Expand All @@ -166,7 +166,7 @@ def max_length(self) -> Optional[int]:
def max_length(self, value: Optional[int]):
if value and not isinstance(value, int):
raise TypeError(f"min_length must be None or int not {value.__class__.__name__}") # type: ignore
if 0 < value <= 4000:
if value <= 0 or value > 4000:
raise ValueError("max_length must be between 1 and 4000")
self._underlying.max_length = value

Expand Down

0 comments on commit 96b3859

Please sign in to comment.