From 06f4052e0fa260a18a7758c7d4c45470f697655e Mon Sep 17 00:00:00 2001 From: DA-344 <108473820+DA-344@users.noreply.github.com> Date: Sun, 29 Jun 2025 18:06:02 +0200 Subject: [PATCH] chore: Add notes on LayoutView behaviour when editing messages --- discord/interactions.py | 6 ++++++ discord/message.py | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/discord/interactions.py b/discord/interactions.py index 1a1eff416..4015c6f19 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -1494,6 +1494,12 @@ class InteractionMessage(Message): The updated view to update this message with. If ``None`` is passed then the view is removed. + .. 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. + .. versionchanged:: 2.6 This now accepts :class:`~discord.ui.LayoutView` instances. delete_after: Optional[:class:`float`] diff --git a/discord/message.py b/discord/message.py index aef8fa4da..c268f682f 100644 --- a/discord/message.py +++ b/discord/message.py @@ -1405,6 +1405,12 @@ class PartialMessage(Hashable): The updated view to update this message with. If ``None`` is passed then the view is removed. + .. 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. + .. versionchanged:: 2.6 This now accepts :class:`~discord.ui.LayoutView` instances. @@ -2991,6 +2997,12 @@ class Message(PartialMessage, Hashable): The updated view to update this message with. If ``None`` is passed then the view is removed. + .. 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. + Raises ------- HTTPException