Skip to content

Commit 226af4e

Browse files
authored
feat(abc): Add support for voice messages (#85)
New Features: - Adds the ability to send voice messages. update-if: you want to send voice messages Signed-off-by: justin <hello@justin.rest>
1 parent 5a37e75 commit 226af4e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

discord/abc.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,8 @@ async def send(
11641164
reference: Optional[Union[Message, MessageReference]] = None,
11651165
mention_author: Optional[bool] = None,
11661166
suppress_embeds: bool = False,
1167-
suppress_notifications: bool = False
1167+
suppress_notifications: bool = False,
1168+
voice_message: bool = False
11681169
) -> Message: # sourcery skip: raise-from-previous-error
11691170
"""|coro|
11701171
@@ -1239,6 +1240,10 @@ async def send(
12391240
Users will still see a ping-symbol when they are mentioned in the message, or the message is in a dm channel.
12401241
12411242
.. versionadded:: 2.0
1243+
1244+
voice_message: :class:`bool`
1245+
Whether to classify the attached file as a voice message, default to :obj:`False`
1246+
Voice messages require a single :class:`~discord.File` attachment with `waveform` and `duration` set.
12421247
12431248
Raises
12441249
--------
@@ -1276,11 +1281,12 @@ async def send(
12761281
else:
12771282
reference = MISSING
12781283

1279-
if suppress_embeds or suppress_notifications:
1284+
if suppress_embeds or suppress_notifications or voice_message:
12801285
from .flags import MessageFlags
12811286
flags = MessageFlags._from_value(0)
12821287
flags.suppress_embeds = suppress_embeds
12831288
flags.suppress_notifications = suppress_notifications
1289+
flags.is_voice_message = voice_message
12841290
else:
12851291
flags = MISSING
12861292

0 commit comments

Comments
 (0)