Skip to content

Commit aa0ad69

Browse files
authored
feat: add waveform parameter in send_voice method (#321)
1 parent a03f684 commit aa0ad69

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

pyrogram/methods/messages/send_voice.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ async def send_voice(
3838
parse_mode: Optional["enums.ParseMode"] = None,
3939
caption_entities: List["types.MessageEntity"] = None,
4040
duration: int = 0,
41+
waveform: Optional[bytes] = None,
4142
disable_notification: bool = None,
4243
message_thread_id: int = None,
4344
direct_messages_topic_id: int = None,
@@ -97,6 +98,9 @@ async def send_voice(
9798
duration (``int``, *optional*):
9899
Duration of the voice message in seconds.
99100
101+
waveform (``bytes``, *optional*):
102+
A 5-bit byte-string waveform info.
103+
100104
disable_notification (``bool``, *optional*):
101105
Sends the message silently.
102106
Users will receive a notification with no sound.
@@ -254,7 +258,8 @@ async def send_voice(
254258
attributes=[
255259
raw.types.DocumentAttributeAudio(
256260
voice=True,
257-
duration=duration
261+
duration=duration,
262+
waveform=waveform,
258263
)
259264
],
260265
ttl_seconds=(1 << 31) - 1 if view_once else None
@@ -276,7 +281,8 @@ async def send_voice(
276281
attributes=[
277282
raw.types.DocumentAttributeAudio(
278283
voice=True,
279-
duration=duration
284+
duration=duration,
285+
waveform=waveform,
280286
)
281287
],
282288
ttl_seconds=(1 << 31) - 1 if view_once else None

0 commit comments

Comments
 (0)