mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-03 08:35:53 +00:00
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:
@ -1310,6 +1310,7 @@ class Webhook(BaseWebhook):
|
||||
view: View = MISSING,
|
||||
thread: Snowflake = MISSING,
|
||||
wait: Literal[True],
|
||||
suppress_embeds: bool = MISSING,
|
||||
) -> WebhookMessage:
|
||||
...
|
||||
|
||||
@ -1330,6 +1331,7 @@ class Webhook(BaseWebhook):
|
||||
view: View = MISSING,
|
||||
thread: Snowflake = MISSING,
|
||||
wait: Literal[False] = ...,
|
||||
suppress_embeds: bool = MISSING,
|
||||
) -> None:
|
||||
...
|
||||
|
||||
@ -1349,6 +1351,7 @@ class Webhook(BaseWebhook):
|
||||
view: View = MISSING,
|
||||
thread: Snowflake = MISSING,
|
||||
wait: bool = False,
|
||||
suppress_embeds: bool = False,
|
||||
) -> Optional[WebhookMessage]:
|
||||
"""|coro|
|
||||
|
||||
@ -1417,6 +1420,10 @@ class Webhook(BaseWebhook):
|
||||
thread: :class:`~discord.abc.Snowflake`
|
||||
The thread to send this webhook to.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
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
|
||||
@ -1447,8 +1454,10 @@ class Webhook(BaseWebhook):
|
||||
previous_mentions: Optional[AllowedMentions] = getattr(self._state, 'allowed_mentions', None)
|
||||
if content is None:
|
||||
content = MISSING
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user