diff --git a/discord/ui/file.py b/discord/ui/file.py index 92b927ac0..acebc5ace 100644 --- a/discord/ui/file.py +++ b/discord/ui/file.py @@ -100,7 +100,15 @@ class File(Item[V]): spoiler=bool(spoiler), id=id, ) - self.id = id + + @property + def id(self) -> Optional[int]: + """Optional[:class:`int`]: The ID of this file component.""" + return self._underlying.id + + @id.setter + def id(self, value: Optional[int]) -> None: + self._underlying.id = value def _is_v2(self): return True diff --git a/discord/ui/separator.py b/discord/ui/separator.py index e6dc61f00..9f34341da 100644 --- a/discord/ui/separator.py +++ b/discord/ui/separator.py @@ -83,6 +83,15 @@ class Separator(Item[V]): def _is_v2(self): return True + @property + def id(self) -> Optional[int]: + """Optional[:class:`int`]: The ID of this separator.""" + return self._underlying.id + + @id.setter + def id(self, value: Optional[int]) -> None: + self._underlying.id = value + @property def visible(self) -> bool: """:class:`bool`: Whether this separator is visible. diff --git a/discord/ui/text_input.py b/discord/ui/text_input.py index de0c8e079..e93a710ca 100644 --- a/discord/ui/text_input.py +++ b/discord/ui/text_input.py @@ -144,11 +144,19 @@ class TextInput(Item[V]): id=id, ) self.row = row - self.id = id def __str__(self) -> str: return self.value + @property + def id(self) -> Optional[int]: + """Optional[:class:`int`]: The ID of this text input.""" + return self._underlying.id + + @id.setter + def id(self, value: Optional[int]) -> None: + self._underlying.id = value + @property def custom_id(self) -> str: """:class:`str`: The ID of the text input that gets received during an interaction."""