Skip to content

Commit 157d8c7

Browse files
authored
adjust item docs
1 parent 846b14d commit 157d8c7

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

discord/ui/item.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from .view import BaseView
4444

4545
I = TypeVar("I", bound="Item")
46-
T = TypeVar("IF", bound="ItemInterface", covariant=True)
46+
T = TypeVar("T", bound="ItemInterface", covariant=True)
4747
V = TypeVar("V", bound="BaseView", covariant=True)
4848
M = TypeVar("M", bound="BaseModal", covariant=True)
4949
ItemCallbackType = Callable[[Any, I, Interaction], Coroutine[Any, Any, Any]]
@@ -52,25 +52,10 @@
5252
class Item(Generic[T]):
5353
"""Represents the base UI item that all UI components inherit from.
5454
55-
The following are the original items supported in :class:`discord.ui.View`:
56-
57-
- :class:`discord.ui.Button`
58-
- :class:`discord.ui.Select`
59-
60-
And the following are new items under the "Components V2" specification for use in :class:`discord.ui.DesignerView`:
61-
62-
- :class:`discord.ui.Section`
63-
- :class:`discord.ui.TextDisplay`
64-
- :class:`discord.ui.Thumbnail`
65-
- :class:`discord.ui.MediaGallery`
66-
- :class:`discord.ui.File`
67-
- :class:`discord.ui.Separator`
68-
- :class:`discord.ui.Container`
69-
7055
.. versionadded:: 2.0
7156
7257
.. versionchanged:: 2.7
73-
Added V2 Components.
58+
Now used as base class for :class:`ViewItem` and :class:`ModalItem`.
7459
"""
7560

7661
__item_repr_attributes__: tuple[str, ...] = ("id",)
@@ -253,6 +238,10 @@ class ModalItem(Item[M]):
253238
- :class:`discord.ui.Label`
254239
- :class:`discord.ui.TextDisplay`
255240
241+
And :class:`discord.ui.Label` should be used in :class:`discord.ui.DesignerModal` to support the following items:
242+
- :class:`discord.ui.InputText`
243+
- :class:`discord.ui.Select`
244+
256245
.. versionadded:: 2.7
257246
"""
258247

0 commit comments

Comments
 (0)