Browse Source

rows

pull/10166/head
DA-344 4 weeks ago
parent
commit
03964172d3
  1. 9
      discord/ui/action_row.py
  2. 2
      discord/ui/container.py
  3. 2
      discord/ui/file.py
  4. 2
      discord/ui/item.py
  5. 2
      discord/ui/media_gallery.py
  6. 2
      discord/ui/section.py
  7. 2
      discord/ui/separator.py
  8. 2
      discord/ui/text_display.py
  9. 2
      discord/ui/thumbnail.py

9
discord/ui/action_row.py

@ -128,6 +128,13 @@ class ActionRow(Item[V]):
---------- ----------
*children: :class:`Item` *children: :class:`Item`
The initial children of this action row. The initial children of this action row.
row: Optional[:class:`int`]
The relative row this action row belongs to. By default
items are arranged automatically into those rows. If you'd
like to control the relative positioning of the row then
passing an index is advised. For example, row=1 will show
up before row=2. Defaults to ``None``, which is automatic
ordering. The row number must be between 0 and 39 (i.e. zero indexed)
id: Optional[:class:`int`] id: Optional[:class:`int`]
The ID of this component. This must be unique across the view. The ID of this component. This must be unique across the view.
""" """
@ -139,6 +146,7 @@ class ActionRow(Item[V]):
def __init__( def __init__(
self, self,
*children: Item[V], *children: Item[V],
row: Optional[int] = None,
id: Optional[int] = None, id: Optional[int] = None,
) -> None: ) -> None:
super().__init__() super().__init__()
@ -151,6 +159,7 @@ class ActionRow(Item[V]):
raise ValueError('maximum number of children exceeded') raise ValueError('maximum number of children exceeded')
self.id = id self.id = id
self.row = row
def __init_subclass__(cls) -> None: def __init_subclass__(cls) -> None:
super().__init_subclass__() super().__init_subclass__()

2
discord/ui/container.py

@ -126,7 +126,7 @@ class Container(Item[V]):
like to control the relative positioning of the row then like to control the relative positioning of the row then
passing an index is advised. For example, row=1 will show passing an index is advised. For example, row=1 will show
up before row=2. Defaults to ``None``, which is automatic up before row=2. Defaults to ``None``, which is automatic
ordering. The row number must be between 0 and 9 (i.e. zero indexed) ordering. The row number must be between 0 and 39 (i.e. zero indexed)
id: Optional[:class:`int`] id: Optional[:class:`int`]
The ID of this component. This must be unique across the view. The ID of this component. This must be unique across the view.
""" """

2
discord/ui/file.py

@ -72,7 +72,7 @@ class File(Item[V]):
like to control the relative positioning of the row then like to control the relative positioning of the row then
passing an index is advised. For example, row=1 will show passing an index is advised. For example, row=1 will show
up before row=2. Defaults to ``None``, which is automatic up before row=2. Defaults to ``None``, which is automatic
ordering. The row number must be between 0 and 9 (i.e. zero indexed) ordering. The row number must be between 0 and 39 (i.e. zero indexed)
id: Optional[:class:`int`] id: Optional[:class:`int`]
The ID of this component. This must be unique across the view. The ID of this component. This must be unique across the view.
""" """

2
discord/ui/item.py

@ -80,7 +80,7 @@ class Item(Generic[V]):
# only called upon edit and we're mainly interested during initial creation time. # only called upon edit and we're mainly interested during initial creation time.
self._provided_custom_id: bool = False self._provided_custom_id: bool = False
self._id: Optional[int] = None self._id: Optional[int] = None
self._max_row: int = 5 if not self._is_v2() else 10 self._max_row: int = 5 if not self._is_v2() else 40
self._parent: Optional[Item] = None self._parent: Optional[Item] = None
if self._is_v2(): if self._is_v2():

2
discord/ui/media_gallery.py

@ -61,7 +61,7 @@ class MediaGallery(Item[V]):
like to control the relative positioning of the row then like to control the relative positioning of the row then
passing an index is advised. For example, row=1 will show passing an index is advised. For example, row=1 will show
up before row=2. Defaults to ``None``, which is automatic up before row=2. Defaults to ``None``, which is automatic
ordering. The row number must be between 0 and 9 (i.e. zero indexed) ordering. The row number must be between 0 and 39 (i.e. zero indexed)
id: Optional[:class:`int`] id: Optional[:class:`int`]
The ID of this component. This must be unique across the view. The ID of this component. This must be unique across the view.
""" """

2
discord/ui/section.py

@ -60,7 +60,7 @@ class Section(Item[V]):
like to control the relative positioning of the row then like to control the relative positioning of the row then
passing an index is advised. For example, row=1 will show passing an index is advised. For example, row=1 will show
up before row=2. Defaults to ``None``, which is automatic up before row=2. Defaults to ``None``, which is automatic
ordering. The row number must be between 0 and 9 (i.e. zero indexed) ordering. The row number must be between 0 and 39 (i.e. zero indexed)
id: Optional[:class:`int`] id: Optional[:class:`int`]
The ID of this component. This must be unique across the view. The ID of this component. This must be unique across the view.
""" """

2
discord/ui/separator.py

@ -59,7 +59,7 @@ class Separator(Item[V]):
like to control the relative positioning of the row then like to control the relative positioning of the row then
passing an index is advised. For example, row=1 will show passing an index is advised. For example, row=1 will show
up before row=2. Defaults to ``None``, which is automatic up before row=2. Defaults to ``None``, which is automatic
ordering. The row number must be between 0 and 9 (i.e. zero indexed) ordering. The row number must be between 0 and 39 (i.e. zero indexed)
id: Optional[:class:`int`] id: Optional[:class:`int`]
The ID of this component. This must be unique across the view. The ID of this component. This must be unique across the view.
""" """

2
discord/ui/text_display.py

@ -56,7 +56,7 @@ class TextDisplay(Item[V]):
like to control the relative positioning of the row then like to control the relative positioning of the row then
passing an index is advised. For example, row=1 will show passing an index is advised. For example, row=1 will show
up before row=2. Defaults to ``None``, which is automatic up before row=2. Defaults to ``None``, which is automatic
ordering. The row number must be between 0 and 9 (i.e. zero indexed) ordering. The row number must be between 0 and 39 (i.e. zero indexed)
id: Optional[:class:`int`] id: Optional[:class:`int`]
The ID of this component. This must be unique across the view. The ID of this component. This must be unique across the view.
""" """

2
discord/ui/thumbnail.py

@ -61,7 +61,7 @@ class Thumbnail(Item[V]):
like to control the relative positioning of the row then like to control the relative positioning of the row then
passing an index is advised. For example, row=1 will show passing an index is advised. For example, row=1 will show
up before row=2. Defaults to ``None``, which is automatic up before row=2. Defaults to ``None``, which is automatic
ordering. The row number must be between 0 and 9 (i.e. zero indexed) ordering. The row number must be between 0 and 39 (i.e. zero indexed)
id: Optional[:class:`int`] id: Optional[:class:`int`]
The ID of this component. This must be unique across the view. The ID of this component. This must be unique across the view.
""" """

Loading…
Cancel
Save