Skip to content

Commit fe2ccc6

Browse files
committed
Clean up Message docstrings
1 parent 8f56610 commit fe2ccc6

File tree

1 file changed

+92
-90
lines changed
  • pyrogram/client/types/messages_and_media

1 file changed

+92
-90
lines changed

pyrogram/client/types/messages_and_media/message.py

Lines changed: 92 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -817,23 +817,22 @@ def reply_animation(
817817
instructions to remove reply keyboard or to force a reply from the user.
818818
819819
progress (``callable``, *optional*):
820-
Pass a callback function to view the upload progress.
821-
The function must take *(client, current, total, \*args)* as positional arguments (look at the section
822-
below for a detailed description).
820+
Pass a callback function to view the file transmission progress.
821+
The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
822+
detailed description) and will be called back each time a new file chunk has been successfully
823+
transmitted.
823824
824825
progress_args (``tuple``, *optional*):
825-
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass
826-
a chat_id and a message_id in order to edit a message with the updated progress.
826+
Extra custom arguments for the progress callback function.
827+
You can pass anything you need to be available in the progress callback scope; for example, a Message
828+
object or a Client instance in order to edit the message with the updated progress status.
827829
828830
Other Parameters:
829-
client (:obj:`Client`):
830-
The Client itself, useful when you want to call other API methods inside the callback function.
831-
832831
current (``int``):
833-
The amount of bytes uploaded so far.
832+
The amount of bytes transmitted so far.
834833
835834
total (``int``):
836-
The size of the file.
835+
The total size of the file.
837836
838837
*args (``tuple``, *optional*):
839838
Extra custom arguments as defined in the *progress_args* parameter.
@@ -954,23 +953,22 @@ def reply_audio(
954953
instructions to remove reply keyboard or to force a reply from the user.
955954
956955
progress (``callable``, *optional*):
957-
Pass a callback function to view the upload progress.
958-
The function must take *(client, current, total, \*args)* as positional arguments (look at the section
959-
below for a detailed description).
956+
Pass a callback function to view the file transmission progress.
957+
The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
958+
detailed description) and will be called back each time a new file chunk has been successfully
959+
transmitted.
960960
961961
progress_args (``tuple``, *optional*):
962-
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass
963-
a chat_id and a message_id in order to edit a message with the updated progress.
962+
Extra custom arguments for the progress callback function.
963+
You can pass anything you need to be available in the progress callback scope; for example, a Message
964+
object or a Client instance in order to edit the message with the updated progress status.
964965
965966
Other Parameters:
966-
client (:obj:`Client`):
967-
The Client itself, useful when you want to call other API methods inside the callback function.
968-
969967
current (``int``):
970-
The amount of bytes uploaded so far.
968+
The amount of bytes transmitted so far.
971969
972970
total (``int``):
973-
The size of the file.
971+
The total size of the file.
974972
975973
*args (``tuple``, *optional*):
976974
Extra custom arguments as defined in the *progress_args* parameter.
@@ -1286,23 +1284,22 @@ def reply_document(
12861284
instructions to remove reply keyboard or to force a reply from the user.
12871285
12881286
progress (``callable``, *optional*):
1289-
Pass a callback function to view the upload progress.
1290-
The function must take *(client, current, total, \*args)* as positional arguments (look at the section
1291-
below for a detailed description).
1287+
Pass a callback function to view the file transmission progress.
1288+
The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
1289+
detailed description) and will be called back each time a new file chunk has been successfully
1290+
transmitted.
12921291
12931292
progress_args (``tuple``, *optional*):
1294-
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass
1295-
a chat_id and a message_id in order to edit a message with the updated progress.
1293+
Extra custom arguments for the progress callback function.
1294+
You can pass anything you need to be available in the progress callback scope; for example, a Message
1295+
object or a Client instance in order to edit the message with the updated progress status.
12961296
12971297
Other Parameters:
1298-
client (:obj:`Client`):
1299-
The Client itself, useful when you want to call other API methods inside the callback function.
1300-
13011298
current (``int``):
1302-
The amount of bytes uploaded so far.
1299+
The amount of bytes transmitted so far.
13031300
13041301
total (``int``):
1305-
The size of the file.
1302+
The total size of the file.
13061303
13071304
*args (``tuple``, *optional*):
13081305
Extra custom arguments as defined in the *progress_args* parameter.
@@ -1681,23 +1678,22 @@ def reply_photo(
16811678
instructions to remove reply keyboard or to force a reply from the user.
16821679
16831680
progress (``callable``, *optional*):
1684-
Pass a callback function to view the upload progress.
1685-
The function must take *(client, current, total, \*args)* as positional arguments (look at the section
1686-
below for a detailed description).
1681+
Pass a callback function to view the file transmission progress.
1682+
The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
1683+
detailed description) and will be called back each time a new file chunk has been successfully
1684+
transmitted.
16871685
16881686
progress_args (``tuple``, *optional*):
1689-
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass
1690-
a chat_id and a message_id in order to edit a message with the updated progress.
1687+
Extra custom arguments for the progress callback function.
1688+
You can pass anything you need to be available in the progress callback scope; for example, a Message
1689+
object or a Client instance in order to edit the message with the updated progress status.
16911690
16921691
Other Parameters:
1693-
client (:obj:`Client`):
1694-
The Client itself, useful when you want to call other API methods inside the callback function.
1695-
16961692
current (``int``):
1697-
The amount of bytes uploaded so far.
1693+
The amount of bytes transmitted so far.
16981694
16991695
total (``int``):
1700-
The size of the file.
1696+
The total size of the file.
17011697
17021698
*args (``tuple``, *optional*):
17031699
Extra custom arguments as defined in the *progress_args* parameter.
@@ -1859,23 +1855,22 @@ def reply_sticker(
18591855
instructions to remove reply keyboard or to force a reply from the user.
18601856
18611857
progress (``callable``, *optional*):
1862-
Pass a callback function to view the upload progress.
1863-
The function must take *(client, current, total, \*args)* as positional arguments (look at the section
1864-
below for a detailed description).
1858+
Pass a callback function to view the file transmission progress.
1859+
The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
1860+
detailed description) and will be called back each time a new file chunk has been successfully
1861+
transmitted.
18651862
18661863
progress_args (``tuple``, *optional*):
1867-
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass
1868-
a chat_id and a message_id in order to edit a message with the updated progress.
1864+
Extra custom arguments for the progress callback function.
1865+
You can pass anything you need to be available in the progress callback scope; for example, a Message
1866+
object or a Client instance in order to edit the message with the updated progress status.
18691867
18701868
Other Parameters:
1871-
client (:obj:`Client`):
1872-
The Client itself, useful when you want to call other API methods inside the callback function.
1873-
18741869
current (``int``):
1875-
The amount of bytes uploaded so far.
1870+
The amount of bytes transmitted so far.
18761871
18771872
total (``int``):
1878-
The size of the file.
1873+
The total size of the file.
18791874
18801875
*args (``tuple``, *optional*):
18811876
Extra custom arguments as defined in the *progress_args* parameter.
@@ -2092,23 +2087,22 @@ def reply_video(
20922087
instructions to remove reply keyboard or to force a reply from the user.
20932088
20942089
progress (``callable``, *optional*):
2095-
Pass a callback function to view the upload progress.
2096-
The function must take *(client, current, total, \*args)* as positional arguments (look at the section
2097-
below for a detailed description).
2090+
Pass a callback function to view the file transmission progress.
2091+
The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
2092+
detailed description) and will be called back each time a new file chunk has been successfully
2093+
transmitted.
20982094
20992095
progress_args (``tuple``, *optional*):
2100-
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass
2101-
a chat_id and a message_id in order to edit a message with the updated progress.
2096+
Extra custom arguments for the progress callback function.
2097+
You can pass anything you need to be available in the progress callback scope; for example, a Message
2098+
object or a Client instance in order to edit the message with the updated progress status.
21022099
21032100
Other Parameters:
2104-
client (:obj:`Client`):
2105-
The Client itself, useful when you want to call other API methods inside the callback function.
2106-
21072101
current (``int``):
2108-
The amount of bytes uploaded so far.
2102+
The amount of bytes transmitted so far.
21092103
21102104
total (``int``):
2111-
The size of the file.
2105+
The total size of the file.
21122106
21132107
*args (``tuple``, *optional*):
21142108
Extra custom arguments as defined in the *progress_args* parameter.
@@ -2214,23 +2208,22 @@ def reply_video_note(
22142208
instructions to remove reply keyboard or to force a reply from the user.
22152209
22162210
progress (``callable``, *optional*):
2217-
Pass a callback function to view the upload progress.
2218-
The function must take *(client, current, total, \*args)* as positional arguments (look at the section
2219-
below for a detailed description).
2211+
Pass a callback function to view the file transmission progress.
2212+
The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
2213+
detailed description) and will be called back each time a new file chunk has been successfully
2214+
transmitted.
22202215
22212216
progress_args (``tuple``, *optional*):
2222-
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass
2223-
a chat_id and a message_id in order to edit a message with the updated progress.
2217+
Extra custom arguments for the progress callback function.
2218+
You can pass anything you need to be available in the progress callback scope; for example, a Message
2219+
object or a Client instance in order to edit the message with the updated progress status.
22242220
22252221
Other Parameters:
2226-
client (:obj:`Client`):
2227-
The Client itself, useful when you want to call other API methods inside the callback function.
2228-
22292222
current (``int``):
2230-
The amount of bytes uploaded so far.
2223+
The amount of bytes transmitted so far.
22312224
22322225
total (``int``):
2233-
The size of the file.
2226+
The total size of the file.
22342227
22352228
*args (``tuple``, *optional*):
22362229
Extra custom arguments as defined in the *progress_args* parameter.
@@ -2333,23 +2326,22 @@ def reply_voice(
23332326
instructions to remove reply keyboard or to force a reply from the user.
23342327
23352328
progress (``callable``, *optional*):
2336-
Pass a callback function to view the upload progress.
2337-
The function must take *(client, current, total, \*args)* as positional arguments (look at the section
2338-
below for a detailed description).
2329+
Pass a callback function to view the file transmission progress.
2330+
The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
2331+
detailed description) and will be called back each time a new file chunk has been successfully
2332+
transmitted.
23392333
23402334
progress_args (``tuple``, *optional*):
2341-
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass
2342-
a chat_id and a message_id in order to edit a message with the updated progress.
2335+
Extra custom arguments for the progress callback function.
2336+
You can pass anything you need to be available in the progress callback scope; for example, a Message
2337+
object or a Client instance in order to edit the message with the updated progress status.
23432338
23442339
Other Parameters:
2345-
client (:obj:`Client`):
2346-
The Client itself, useful when you want to call other API methods inside the callback function.
2347-
23482340
current (``int``):
2349-
The amount of bytes uploaded so far.
2341+
The amount of bytes transmitted so far.
23502342
23512343
total (``int``):
2352-
The size of the file.
2344+
The total size of the file.
23532345
23542346
*args (``tuple``, *optional*):
23552347
Extra custom arguments as defined in the *progress_args* parameter.
@@ -2619,9 +2611,6 @@ def forward(
26192611
if self.game and not self._client.is_bot:
26202612
raise ValueError("Users cannot send messages with Game media type")
26212613

2622-
# TODO: Improve markdown parser. Currently html appears to be more stable, thus we use it here because users
2623-
# can"t choose.
2624-
26252614
if self.text:
26262615
return self._client.send_message(
26272616
chat_id,
@@ -2900,14 +2889,27 @@ def download(
29002889
Blocks the code execution until the file has been downloaded.
29012890
Defaults to True.
29022891
2903-
progress (``callable``):
2904-
Pass a callback function to view the download progress.
2905-
The function must take *(client, current, total, \*args)* as positional arguments (look at the section
2906-
below for a detailed description).
2892+
progress (``callable``, *optional*):
2893+
Pass a callback function to view the file transmission progress.
2894+
The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
2895+
detailed description) and will be called back each time a new file chunk has been successfully
2896+
transmitted.
2897+
2898+
progress_args (``tuple``, *optional*):
2899+
Extra custom arguments for the progress callback function.
2900+
You can pass anything you need to be available in the progress callback scope; for example, a Message
2901+
object or a Client instance in order to edit the message with the updated progress status.
2902+
2903+
Other Parameters:
2904+
current (``int``):
2905+
The amount of bytes transmitted so far.
2906+
2907+
total (``int``):
2908+
The total size of the file.
29072909
2908-
progress_args (``tuple``):
2909-
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass
2910-
a chat_id and a message_id in order to edit a message with the updated progress.
2910+
*args (``tuple``, *optional*):
2911+
Extra custom arguments as defined in the *progress_args* parameter.
2912+
You can either keep *\*args* or add every single extra argument in your function signature.
29112913
29122914
Returns:
29132915
On success, the absolute path of the downloaded file as string is returned, None otherwise.

0 commit comments

Comments
 (0)