Skip to content

Commit 4ad132c

Browse files
feat: allow embed suppression in interaction responses (#1094)
* feat: allow embed suppression in interaction responses * docs(docstrings): add toricane's suggestion Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> * docs(docstrings): add toricane's suggestion (Again) Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com>
1 parent 740f0c8 commit 4ad132c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

interactions/client/context.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ async def send(
120120
Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]
121121
] = MISSING,
122122
ephemeral: Optional[bool] = False,
123+
suppress_embeds: bool = False,
123124
) -> dict:
124125
"""
125126
This allows the invocation state described in the "context"
@@ -139,6 +140,8 @@ async def send(
139140
:type components?: Optional[Union[ActionRow, Button, SelectMenu, List[Union[ActionRow, Button, SelectMenu]]]]
140141
:param ephemeral?: Whether the response is hidden or not.
141142
:type ephemeral?: Optional[bool]
143+
:param suppress_embeds: Whether embeds are not shown in the message.
144+
:type suppress_embeds: bool
142145
:return: The sent message as an object.
143146
:rtype: Message
144147
"""
@@ -189,7 +192,9 @@ async def send(
189192
else:
190193
_components = []
191194

192-
_ephemeral: int = (1 << 6) if ephemeral else 0
195+
_flags: int = (1 << 6) if ephemeral else 0
196+
if suppress_embeds:
197+
_flags += 1 << 2
193198

194199
_attachments = [] if attachments is MISSING else [a._json for a in attachments]
195200

@@ -200,7 +205,7 @@ async def send(
200205
allowed_mentions=_allowed_mentions,
201206
components=_components,
202207
attachments=_attachments,
203-
flags=_ephemeral,
208+
flags=_flags,
204209
)
205210

206211
async def edit(

0 commit comments

Comments
 (0)