Browse Source

fix: documentation errors

pull/10166/head
DA-344 3 months ago
parent
commit
5d1300d9fc
  1. 2
      discord/components.py
  2. 2
      discord/ui/file.py
  3. 2
      discord/ui/media_gallery.py
  4. 2
      discord/ui/separator.py
  5. 2
      discord/ui/thumbnail.py
  6. 6
      discord/ui/view.py

2
discord/components.py

@ -107,6 +107,8 @@ __all__ = (
'MediaGalleryComponent', 'MediaGalleryComponent',
'FileComponent', 'FileComponent',
'SectionComponent', 'SectionComponent',
'Container',
'TextDisplay',
) )

2
discord/ui/file.py

@ -46,7 +46,7 @@ class File(Item[V]):
Parameters Parameters
---------- ----------
media: Union[:class:`str`, :class:`.UnfurledMediaItem`] media: Union[:class:`str`, :class:`discord.UnfurledMediaItem`]
This file's media. If this is a string itmust point to a local This file's media. If this is a string itmust point to a local
file uploaded within the parent view of this item, and must file uploaded within the parent view of this item, and must
meet the ``attachment://file-name.extension`` structure. meet the ``attachment://file-name.extension`` structure.

2
discord/ui/media_gallery.py

@ -45,7 +45,7 @@ __all__ = ('MediaGallery',)
class MediaGallery(Item[V]): class MediaGallery(Item[V]):
"""Represents a UI media gallery. """Represents a UI media gallery.
This can contain up to 10 :class:`MediaGalleryItem`s. This can contain up to 10 :class:`.MediaGalleryItem`s.
.. versionadded:: 2.6 .. versionadded:: 2.6

2
discord/ui/separator.py

@ -49,7 +49,7 @@ class Separator(Item[V]):
visible: :class:`bool` visible: :class:`bool`
Whether this separator is visible. On the client side this Whether this separator is visible. On the client side this
is whether a divider line should be shown or not. is whether a divider line should be shown or not.
spacing: :class:`discord.SeparatorSize` spacing: :class:`.SeparatorSize`
The spacing of this separator. The spacing of this separator.
row: Optional[:class:`int`] row: Optional[:class:`int`]
The relative row this separator belongs to. By default The relative row this separator belongs to. By default

2
discord/ui/thumbnail.py

@ -47,7 +47,7 @@ class Thumbnail(Item[V]):
Parameters Parameters
---------- ----------
media: Union[:class:`str`, :class:`.UnfurledMediaItem`] media: Union[:class:`str`, :class:`discord.UnfurledMediaItem`]
The media of the thumbnail. This can be a string that points to a local The media of the thumbnail. This can be a string that points to a local
attachment uploaded within this item. URLs must match the ``attachment://file-name.extension`` attachment uploaded within this item. URLs must match the ``attachment://file-name.extension``
structure. structure.

6
discord/ui/view.py

@ -61,7 +61,7 @@ if TYPE_CHECKING:
from ..interactions import Interaction from ..interactions import Interaction
from ..message import Message from ..message import Message
from ..types.components import Component as ComponentPayload from ..types.components import ComponentBase as ComponentBasePayload
from ..types.interactions import ModalSubmitComponentInteractionData as ModalSubmitComponentInteractionDataPayload from ..types.interactions import ModalSubmitComponentInteractionData as ModalSubmitComponentInteractionDataPayload
from ..state import ConnectionState from ..state import ConnectionState
from .modal import Modal from .modal import Modal
@ -802,11 +802,11 @@ class ViewStore:
def remove_message_tracking(self, message_id: int) -> Optional[View]: def remove_message_tracking(self, message_id: int) -> Optional[View]:
return self._synced_message_views.pop(message_id, None) return self._synced_message_views.pop(message_id, None)
def update_from_message(self, message_id: int, data: List[ComponentPayload]) -> None: def update_from_message(self, message_id: int, data: List[ComponentBasePayload]) -> None:
components: List[Component] = [] components: List[Component] = []
for component_data in data: for component_data in data:
component = _component_factory(component_data, self._state) component = _component_factory(component_data, self._state) # type: ignore
if component is not None: if component is not None:
components.append(component) components.append(component)

Loading…
Cancel
Save