mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-23 03:16:48 +00:00
Add missing suppress_embeds kwarg to InteractionResponse.edit_message
This commit is contained in:
parent
d9f81150e1
commit
f6182e5763
@ -851,6 +851,7 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
view: Optional[View] = MISSING,
|
view: Optional[View] = MISSING,
|
||||||
allowed_mentions: Optional[AllowedMentions] = MISSING,
|
allowed_mentions: Optional[AllowedMentions] = MISSING,
|
||||||
delete_after: Optional[float] = None,
|
delete_after: Optional[float] = None,
|
||||||
|
suppress_embeds: bool = MISSING,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
@ -886,6 +887,13 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
then it is silently ignored.
|
then it is silently ignored.
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
.. 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
|
Raises
|
||||||
-------
|
-------
|
||||||
@ -917,6 +925,12 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
if view is not MISSING and message_id is not None:
|
if view is not MISSING and message_id is not None:
|
||||||
state.prevent_view_updates_for(message_id)
|
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()
|
adapter = async_context.get()
|
||||||
params = interaction_message_response_params(
|
params = interaction_message_response_params(
|
||||||
type=InteractionResponseType.message_update.value,
|
type=InteractionResponseType.message_update.value,
|
||||||
@ -927,6 +941,7 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
attachments=attachments,
|
attachments=attachments,
|
||||||
previous_allowed_mentions=parent._state.allowed_mentions,
|
previous_allowed_mentions=parent._state.allowed_mentions,
|
||||||
allowed_mentions=allowed_mentions,
|
allowed_mentions=allowed_mentions,
|
||||||
|
flags=flags,
|
||||||
)
|
)
|
||||||
|
|
||||||
http = parent._state.http
|
http = parent._state.http
|
||||||
|
Loading…
x
Reference in New Issue
Block a user