2727
2828
2929class Send (Scaffold ):
30- async def send (self , data : TLObject , retries : int = Session .MAX_RETRIES , timeout : float = Session .WAIT_TIMEOUT ):
30+ async def send (
31+ self ,
32+ data : TLObject ,
33+ retries : int = Session .MAX_RETRIES ,
34+ timeout : float = Session .WAIT_TIMEOUT ,
35+ sleep_threshold : float = None
36+ ):
3137 """Send raw Telegram queries.
3238
3339 This method makes it possible to manually call every single Telegram API method in a low-level manner.
@@ -50,6 +56,9 @@ async def send(self, data: TLObject, retries: int = Session.MAX_RETRIES, timeout
5056 timeout (``float``):
5157 Timeout in seconds.
5258
59+ sleep_threshold (``float``):
60+ Sleep threshold in seconds.
61+
5362 Returns:
5463 ``RawType``: The raw type response generated by the query.
5564
@@ -65,7 +74,7 @@ async def send(self, data: TLObject, retries: int = Session.MAX_RETRIES, timeout
6574 if self .takeout_id :
6675 data = raw .functions .InvokeWithTakeout (takeout_id = self .takeout_id , query = data )
6776
68- r = await self .session .send (data , retries , timeout , self .sleep_threshold )
77+ r = await self .session .send (data , retries , timeout , sleep_threshold or self .sleep_threshold )
6978
7079 await self .fetch_peers (getattr (r , "users" , []))
7180 await self .fetch_peers (getattr (r , "chats" , []))
0 commit comments