From f6182e57630903a4fc84cddf4fcf4219cb19d3e4 Mon Sep 17 00:00:00 2001 From: Soheab_ <33902984+Soheab@users.noreply.github.com> Date: Sun, 10 Dec 2023 23:07:50 +0100 Subject: [PATCH] Add missing suppress_embeds kwarg to InteractionResponse.edit_message --- discord/interactions.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/discord/interactions.py b/discord/interactions.py index 06916de4b..48e73855e 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -851,6 +851,7 @@ class InteractionResponse(Generic[ClientT]): view: Optional[View] = MISSING, allowed_mentions: Optional[AllowedMentions] = MISSING, delete_after: Optional[float] = None, + suppress_embeds: bool = MISSING, ) -> None: """|coro| @@ -886,6 +887,13 @@ class InteractionResponse(Generic[ClientT]): then it is silently ignored. .. versionadded:: 2.2 + suppress_embeds: :class:`bool` + Whether to suppress embeds for the message. This removes + all the embeds if set to ``True``. If set to ``False`` + this brings the embeds back if they were suppressed. + Using this parameter requires :attr:`~.Permissions.manage_messages`. + + .. versionadded:: 2.4 Raises ------- @@ -917,6 +925,12 @@ class InteractionResponse(Generic[ClientT]): if view is not MISSING and message_id is not None: state.prevent_view_updates_for(message_id) + if suppress_embeds is not MISSING: + flags = MessageFlags._from_value(0) + flags.suppress_embeds = suppress_embeds + else: + flags = MISSING + adapter = async_context.get() params = interaction_message_response_params( type=InteractionResponseType.message_update.value, @@ -927,6 +941,7 @@ class InteractionResponse(Generic[ClientT]): attachments=attachments, previous_allowed_mentions=parent._state.allowed_mentions, allowed_mentions=allowed_mentions, + flags=flags, ) http = parent._state.http