@@ -34,6 +34,7 @@ async def invoke(
3434 retries : int = Session .MAX_RETRIES ,
3535 timeout : float = Session .WAIT_TIMEOUT ,
3636 sleep_threshold : float = None ,
37+ retry_delay : float = Session .RETRY_DELAY ,
3738 business_connection_id : str = None
3839 ):
3940 """Invoke raw Telegram functions.
@@ -54,15 +55,18 @@ async def invoke(
5455 query (``RawFunction``):
5556 The API Schema function filled with proper arguments.
5657
57- retries (``int``):
58+ retries (``int``, *optional* ):
5859 Number of retries.
5960
60- timeout (``float``):
61+ timeout (``float`, *optional* `):
6162 Timeout in seconds.
6263
63- sleep_threshold (``float``):
64+ sleep_threshold (``float``, *optional* ):
6465 Sleep threshold in seconds.
6566
67+ retry_delay (``float``, *optional*):
68+ Retry delay in seconds on errors.
69+
6670 business_connection_id (``str``, *optional*):
6771 Unique identifier of the business connection.
6872
@@ -92,10 +96,11 @@ async def invoke(
9296 query = raw .functions .InvokeWithTakeout (takeout_id = self .takeout_id , query = query )
9397
9498 r = await session .invoke (
95- query , retries , timeout ,
96- (sleep_threshold
97- if sleep_threshold is not None
98- else self .sleep_threshold )
99+ query = query , retries = retries , timeout = timeout ,
100+ sleep_threshold = (
101+ sleep_threshold if sleep_threshold is not None else self .sleep_threshold
102+ ),
103+ retry_delay = retry_delay
99104 )
100105
101106 await self .fetch_peers (getattr (r , "users" , []))
0 commit comments