From 65db1418871f096c265b9a3edc8a0c46cd3a62d1 Mon Sep 17 00:00:00 2001 From: Krittick Date: Sun, 20 Feb 2022 17:55:19 -0800 Subject: [PATCH] change custom_id MISSING comparison to `None` for Select class to match other components --- discord/ui/select.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discord/ui/select.py b/discord/ui/select.py index ac5fd9c34e..56401bf08e 100644 --- a/discord/ui/select.py +++ b/discord/ui/select.py @@ -96,7 +96,7 @@ class Select(Item[V]): def __init__( self, *, - custom_id: str = MISSING, + custom_id: str = None, placeholder: Optional[str] = None, min_values: int = 1, max_values: int = 1, @@ -110,8 +110,8 @@ def __init__( if not (isinstance(custom_id, str) or custom_id is None): raise TypeError(f"expected custom_id to be str, not {custom_id.__class__.__name__}") - self._provided_custom_id = custom_id is not MISSING - custom_id = os.urandom(16).hex() if custom_id is MISSING else custom_id + self._provided_custom_id = custom_id is not None + custom_id = os.urandom(16).hex() if custom_id is None else custom_id options = [] if options is MISSING else options self._underlying = SelectMenu._raw_construct( custom_id=custom_id, @@ -297,7 +297,7 @@ def is_dispatchable(self) -> bool: def select( *, placeholder: Optional[str] = None, - custom_id: str = MISSING, + custom_id: str = None, min_values: int = 1, max_values: int = 1, options: List[SelectOption] = MISSING,