|
@ -326,7 +326,8 @@ class BaseView: |
|
|
|
|
|
|
|
|
@classmethod |
|
|
@classmethod |
|
|
def from_message(cls, message: Message, /, *, timeout: Optional[float] = 180.0) -> Union[View, LayoutView]: |
|
|
def from_message(cls, message: Message, /, *, timeout: Optional[float] = 180.0) -> Union[View, LayoutView]: |
|
|
"""Converts a message's components into a :class:`View`. |
|
|
"""Converts a message's components into a :class:`View` |
|
|
|
|
|
or :class:`LayoutView`. |
|
|
|
|
|
|
|
|
The :attr:`.Message.components` of a message are read-only |
|
|
The :attr:`.Message.components` of a message are read-only |
|
|
and separate types from those in the ``discord.ui`` namespace. |
|
|
and separate types from those in the ``discord.ui`` namespace. |
|
@ -768,6 +769,9 @@ class LayoutView(BaseView): |
|
|
|
|
|
|
|
|
This object must be inherited to create a UI within Discord. |
|
|
This object must be inherited to create a UI within Discord. |
|
|
|
|
|
|
|
|
|
|
|
This differs from a :class:`View` in that it supports all component types |
|
|
|
|
|
and uses what Discord refers to as "v2 components". |
|
|
|
|
|
|
|
|
You can find usage examples in the :resource:`repository <examples>` |
|
|
You can find usage examples in the :resource:`repository <examples>` |
|
|
|
|
|
|
|
|
.. versionadded:: 2.6 |
|
|
.. versionadded:: 2.6 |
|
|