Add the suppress_embeds parameter to send methods

Modified the following methods:

- abc.Messageable.send
- Webhook.send
- SyncWebhook.send
- InteractionResponse.send_message
This commit is contained in:
Stocker
2022-03-05 22:19:33 -05:00
committed by GitHub
parent 82464419ce
commit 554d2d7c99
4 changed files with 50 additions and 5 deletions

View File

@@ -494,6 +494,7 @@ class InteractionResponse:
tts: bool = False,
ephemeral: bool = False,
allowed_mentions: AllowedMentions = MISSING,
suppress_embeds: bool = False,
) -> None:
"""|coro|
@@ -524,6 +525,10 @@ class InteractionResponse:
allowed_mentions: :class:`~discord.AllowedMentions`
Controls the mentions being processed in this message. See :meth:`.abc.Messageable.send` for
more information.
suppress_embeds: :class:`bool`
Whether to suppress embeds for the message. This sends the message without any embeds if set to ``True``.
.. versionadded:: 2.0
Raises
-------
@@ -539,8 +544,10 @@ class InteractionResponse:
if self._responded:
raise InteractionResponded(self._parent)
if ephemeral:
flags = MessageFlags._from_value(64)
if ephemeral or suppress_embeds:
flags = MessageFlags._from_value(0)
flags.ephemeral = ephemeral
flags.suppress_embeds = suppress_embeds
else:
flags = MISSING