Browse Source

chore: Clarify note on message edit related methods

pull/10166/head
DA-344 3 weeks ago
parent
commit
67d67d3495
  1. 23
      discord/interactions.py
  2. 5
      discord/message.py
  3. 6
      discord/webhook/async_.py

23
discord/interactions.py

@ -540,9 +540,18 @@ class Interaction(Generic[ClientT]):
allowed_mentions: :class:`AllowedMentions`
Controls the mentions being processed in this message.
See :meth:`.abc.Messageable.send` for more information.
view: Optional[:class:`~discord.ui.View`]
view: Optional[Union[:class:`~discord.ui.View`, :class:`~discord.ui.LayoutView`]]
The updated view to update this message with. If ``None`` is passed then
the view is removed.
.. note::
To update the message to add a :class:`~discord.ui.LayoutView`, you
must explicitly set the ``content``, ``embed``, ``embeds``, and
``attachments`` parameters to either ``None`` or an empty array, as appropriate.
.. versionchanged:: 2.6
This now accepts :class:`~discord.ui.LayoutView` instances.
poll: :class:`Poll`
The poll to create when editing the message.
@ -1178,6 +1187,12 @@ class InteractionResponse(Generic[ClientT]):
The updated view to update this message with. If ``None`` is passed then
the view is removed.
.. note::
To update the message to add a :class:`~discord.ui.LayoutView`, you
must explicitly set the ``content``, ``embed``, ``embeds``, and
``attachments`` parameters to either ``None`` or an empty array, as appropriate.
.. versionchanged:: 2.6
This now accepts :class:`~discord.ui.LayoutView` instances.
allowed_mentions: Optional[:class:`~discord.AllowedMentions`]
@ -1496,9 +1511,9 @@ class InteractionMessage(Message):
.. note::
If you want to update the message to have a :class:`~discord.ui.LayoutView`, you must
explicitly set to ``None`` or empty array, as required, the ``content``, ``embed``,
``embeds``, and ``attachments`` parameters.
To update the message to add a :class:`~discord.ui.LayoutView`, you
must explicitly set the ``content``, ``embed``, ``embeds``, and
``attachments`` parameters to either ``None`` or an empty array, as appropriate.
.. versionchanged:: 2.6
This now accepts :class:`~discord.ui.LayoutView` instances.

5
discord/message.py

@ -2993,7 +2993,7 @@ class Message(PartialMessage, Hashable):
are used instead.
.. versionadded:: 1.4
view: Optional[:class:`~discord.ui.View`]
view: Optional[Union[:class:`~discord.ui.View`, :class:`~discord.ui.LayoutView`]]
The updated view to update this message with. If ``None`` is passed then
the view is removed.
@ -3003,6 +3003,9 @@ class Message(PartialMessage, Hashable):
explicitly set to ``None`` or empty array, as required, the ``content``, ``embed``,
``embeds``, and ``attachments`` parameters.
.. versionchanged:: 2.6
This now accepts :class:`~discord.ui.LayoutView` instances.
Raises
-------
HTTPException

6
discord/webhook/async_.py

@ -2059,6 +2059,12 @@ class Webhook(BaseWebhook):
the view is removed. The webhook must have state attached, similar to
:meth:`send`.
.. note::
To update the message to add a :class:`~discord.ui.LayoutView`, you
must explicitly set the ``content``, ``embed``, ``embeds``, and
``attachments`` parameters to either ``None`` or an empty array, as appropriate.
.. versionadded:: 2.0
.. versionchanged:: 2.6
This now accepts :class:`~discord.ui.LayoutView` instances.

Loading…
Cancel
Save