1818
1919from typing import Optional
2020
21+ import pyrogram
22+ from pyrogram import raw
23+
2124from ..object import Object
2225
2326
@@ -44,13 +47,14 @@ class TranscribedAudio(Object):
4447 def __init__ (
4548 self ,
4649 * ,
50+ client : "pyrogram.Client" = None ,
4751 transcription_id : int ,
4852 text : str ,
4953 pending : Optional [bool ] = None ,
5054 trial_remains_num : Optional [int ] = None ,
5155 trial_remains_until_date : Optional [int ] = None ,
5256 ):
53- super ().__init__ ()
57+ super ().__init__ (client )
5458
5559 self .transcription_id = transcription_id
5660 self .text = text
@@ -59,11 +63,15 @@ def __init__(
5963 self .trial_remains_until_date = trial_remains_until_date
6064
6165 @staticmethod
62- def _parse (transcribed_audio ) -> Optional ["TranscribedAudio" ]:
63- if transcribed_audio is None :
66+ def _parse (
67+ client : "pyrogram.Client" ,
68+ transcribed_audio : "raw.types.messages.TranscribedAudio" ,
69+ ) -> Optional ["TranscribedAudio" ]:
70+ if not isinstance (transcribed_audio , raw .types .messages .TranscribedAudio ):
6471 return None
6572
6673 return TranscribedAudio (
74+ client = client ,
6775 transcription_id = transcribed_audio .transcription_id ,
6876 text = transcribed_audio .text ,
6977 pending = transcribed_audio .pending ,
0 commit comments