Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ These changes are available on the `master` branch, but have not yet been releas
([#1852](https://github.com/Pycord-Development/pycord/pull/1852))
- Added new `EmbeddedActivity` values.
([#1859](https://github.com/Pycord-Development/pycord/pull/1859))
- Added new `suppress_notifications` to `MessageFlags.
- Added new `suppress_notifications` to `MessageFlags`.
([#1912](https://github.com/Pycord-Development/pycord/pull/1912))

### Changed
Expand Down
18 changes: 13 additions & 5 deletions discord/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,7 @@ async def send(
mention_author: bool = ...,
view: View = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...

Expand All @@ -1340,6 +1341,7 @@ async def send(
mention_author: bool = ...,
view: View = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...

Expand All @@ -1359,6 +1361,7 @@ async def send(
mention_author: bool = ...,
view: View = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...

Expand All @@ -1378,6 +1381,7 @@ async def send(
mention_author: bool = ...,
view: View = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...

Expand All @@ -1398,6 +1402,7 @@ async def send(
mention_author=None,
view=None,
suppress=None,
silent=None,
):
"""|coro|

Expand Down Expand Up @@ -1471,6 +1476,10 @@ async def send(
.. versionadded:: 2.0
suppress: :class:`bool`
Whether to suppress embeds for the message.
slient: :class:`bool`
Whether to suppress push and desktop notifications for the message.

.. versionadded:: 2.4

Returns
-------
Expand Down Expand Up @@ -1510,11 +1519,10 @@ async def send(
)
embeds = [embed.to_dict() for embed in embeds]

flags = (
MessageFlags.suppress_embeds.flag
if suppress
else MessageFlags.DEFAULT_VALUE
)
flags = MessageFlags(
suppress_embeds=bool(suppress),
suppress_notifications=bool(silent),
).value

if stickers is not None:
stickers = [sticker.id for sticker in stickers]
Expand Down
6 changes: 3 additions & 3 deletions discord/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def ephemeral(self):
def loading(self):
""":class:`bool`: Returns ``True`` if the source message is deferred.

The user sees a 'thinking' state
The user sees a 'thinking' state.

.. versionadded:: 2.0
"""
Expand All @@ -395,9 +395,9 @@ def failed_to_mention_some_roles_in_thread(self):

@flag_value
def suppress_notifications(self):
""":class:`bool`: Returns ``True`` if the source message does not trigger push and desktop notifications
""":class:`bool`: Returns ``True`` if the source message does not trigger push and desktop notifications.

The user will still receive a mention
Users will still receive mentions.

.. versionadded:: 2.4
"""
Expand Down