|
|
@ -47,7 +47,7 @@ from .select import select as _select, Select, UserSelect, RoleSelect, ChannelSe |
|
|
|
from ..components import ActionRow as ActionRowComponent |
|
|
|
from ..enums import ButtonStyle, ComponentType, ChannelType |
|
|
|
from ..partial_emoji import PartialEmoji |
|
|
|
from ..utils import MISSING |
|
|
|
from ..utils import MISSING, get as _utils_get |
|
|
|
|
|
|
|
if TYPE_CHECKING: |
|
|
|
from typing_extensions import Self |
|
|
@ -218,6 +218,26 @@ class ActionRow(Item[V]): |
|
|
|
pass |
|
|
|
return self |
|
|
|
|
|
|
|
def get_item_by_id(self, id: str, /) -> Optional[Item[V]]: |
|
|
|
"""Gets an item with :attr:`Item.id` set as ``id``, or ``None`` if |
|
|
|
not found. |
|
|
|
|
|
|
|
.. warning:: |
|
|
|
|
|
|
|
This is **not the same** as ``custom_id``. |
|
|
|
|
|
|
|
Parameters |
|
|
|
---------- |
|
|
|
id: :class:`str` |
|
|
|
The ID of the component. |
|
|
|
|
|
|
|
Returns |
|
|
|
------- |
|
|
|
Optional[:class:`Item`] |
|
|
|
The item found, or ``None``. |
|
|
|
""" |
|
|
|
return _utils_get(self._children, id=id) |
|
|
|
|
|
|
|
def clear_items(self) -> Self: |
|
|
|
"""Removes all items from the row. |
|
|
|
|
|
|
|