mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-18 04:00:39 +00:00
Fix certain component IDs not being able to be settable afterwards
Fix #10305
This commit is contained in:
@@ -100,7 +100,15 @@ class File(Item[V]):
|
|||||||
spoiler=bool(spoiler),
|
spoiler=bool(spoiler),
|
||||||
id=id,
|
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):
|
def _is_v2(self):
|
||||||
return True
|
return True
|
||||||
|
@@ -83,6 +83,15 @@ class Separator(Item[V]):
|
|||||||
def _is_v2(self):
|
def _is_v2(self):
|
||||||
return True
|
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
|
@property
|
||||||
def visible(self) -> bool:
|
def visible(self) -> bool:
|
||||||
""":class:`bool`: Whether this separator is visible.
|
""":class:`bool`: Whether this separator is visible.
|
||||||
|
@@ -144,11 +144,19 @@ class TextInput(Item[V]):
|
|||||||
id=id,
|
id=id,
|
||||||
)
|
)
|
||||||
self.row = row
|
self.row = row
|
||||||
self.id = id
|
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return self.value
|
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
|
@property
|
||||||
def custom_id(self) -> str:
|
def custom_id(self) -> str:
|
||||||
""":class:`str`: The ID of the text input that gets received during an interaction."""
|
""":class:`str`: The ID of the text input that gets received during an interaction."""
|
||||||
|
Reference in New Issue
Block a user