Skip to content

Commit a5982b9

Browse files
authored
feat: add silent parameter to Messageable.send (#1913)
* feat: add silent parameter to Messageable.send * docs: fix minor inconsistencies
1 parent e18d571 commit a5982b9

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ These changes are available on the `master` branch, but have not yet been releas
2727
([#1852](https://github.com/Pycord-Development/pycord/pull/1852))
2828
- Added new `EmbeddedActivity` values.
2929
([#1859](https://github.com/Pycord-Development/pycord/pull/1859))
30-
- Added new `suppress_notifications` to `MessageFlags.
30+
- Added new `suppress_notifications` to `MessageFlags`.
3131
([#1912](https://github.com/Pycord-Development/pycord/pull/1912))
3232

3333
### Changed

discord/abc.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,7 @@ async def send(
13211321
mention_author: bool = ...,
13221322
view: View = ...,
13231323
suppress: bool = ...,
1324+
silent: bool = ...,
13241325
) -> Message:
13251326
...
13261327

@@ -1340,6 +1341,7 @@ async def send(
13401341
mention_author: bool = ...,
13411342
view: View = ...,
13421343
suppress: bool = ...,
1344+
silent: bool = ...,
13431345
) -> Message:
13441346
...
13451347

@@ -1359,6 +1361,7 @@ async def send(
13591361
mention_author: bool = ...,
13601362
view: View = ...,
13611363
suppress: bool = ...,
1364+
silent: bool = ...,
13621365
) -> Message:
13631366
...
13641367

@@ -1378,6 +1381,7 @@ async def send(
13781381
mention_author: bool = ...,
13791382
view: View = ...,
13801383
suppress: bool = ...,
1384+
silent: bool = ...,
13811385
) -> Message:
13821386
...
13831387

@@ -1398,6 +1402,7 @@ async def send(
13981402
mention_author=None,
13991403
view=None,
14001404
suppress=None,
1405+
silent=None,
14011406
):
14021407
"""|coro|
14031408
@@ -1471,6 +1476,10 @@ async def send(
14711476
.. versionadded:: 2.0
14721477
suppress: :class:`bool`
14731478
Whether to suppress embeds for the message.
1479+
slient: :class:`bool`
1480+
Whether to suppress push and desktop notifications for the message.
1481+
1482+
.. versionadded:: 2.4
14741483
14751484
Returns
14761485
-------
@@ -1510,11 +1519,10 @@ async def send(
15101519
)
15111520
embeds = [embed.to_dict() for embed in embeds]
15121521

1513-
flags = (
1514-
MessageFlags.suppress_embeds.flag
1515-
if suppress
1516-
else MessageFlags.DEFAULT_VALUE
1517-
)
1522+
flags = MessageFlags(
1523+
suppress_embeds=bool(suppress),
1524+
suppress_notifications=bool(silent),
1525+
).value
15181526

15191527
if stickers is not None:
15201528
stickers = [sticker.id for sticker in stickers]

discord/flags.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def ephemeral(self):
379379
def loading(self):
380380
""":class:`bool`: Returns ``True`` if the source message is deferred.
381381
382-
The user sees a 'thinking' state
382+
The user sees a 'thinking' state.
383383
384384
.. versionadded:: 2.0
385385
"""
@@ -395,9 +395,9 @@ def failed_to_mention_some_roles_in_thread(self):
395395

396396
@flag_value
397397
def suppress_notifications(self):
398-
""":class:`bool`: Returns ``True`` if the source message does not trigger push and desktop notifications
398+
""":class:`bool`: Returns ``True`` if the source message does not trigger push and desktop notifications.
399399
400-
The user will still receive a mention
400+
Users will still receive mentions.
401401
402402
.. versionadded:: 2.4
403403
"""

0 commit comments

Comments
 (0)