Clean up Message docstrings

This commit is contained in:
Dan 2019-07-25 11:18:11 +02:00
parent 8f56610c2c
commit fe2ccc6036

View File

@ -817,23 +817,22 @@ class Message(Object, Update):
instructions to remove reply keyboard or to force a reply from the user. instructions to remove reply keyboard or to force a reply from the user.
progress (``callable``, *optional*): progress (``callable``, *optional*):
Pass a callback function to view the upload progress. Pass a callback function to view the file transmission progress.
The function must take *(client, current, total, \*args)* as positional arguments (look at the section The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
below for a detailed description). detailed description) and will be called back each time a new file chunk has been successfully
transmitted.
progress_args (``tuple``, *optional*): progress_args (``tuple``, *optional*):
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass Extra custom arguments for the progress callback function.
a chat_id and a message_id in order to edit a message with the updated progress. You can pass anything you need to be available in the progress callback scope; for example, a Message
object or a Client instance in order to edit the message with the updated progress status.
Other Parameters: Other Parameters:
client (:obj:`Client`):
The Client itself, useful when you want to call other API methods inside the callback function.
current (``int``): current (``int``):
The amount of bytes uploaded so far. The amount of bytes transmitted so far.
total (``int``): total (``int``):
The size of the file. The total size of the file.
*args (``tuple``, *optional*): *args (``tuple``, *optional*):
Extra custom arguments as defined in the *progress_args* parameter. Extra custom arguments as defined in the *progress_args* parameter.
@ -954,23 +953,22 @@ class Message(Object, Update):
instructions to remove reply keyboard or to force a reply from the user. instructions to remove reply keyboard or to force a reply from the user.
progress (``callable``, *optional*): progress (``callable``, *optional*):
Pass a callback function to view the upload progress. Pass a callback function to view the file transmission progress.
The function must take *(client, current, total, \*args)* as positional arguments (look at the section The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
below for a detailed description). detailed description) and will be called back each time a new file chunk has been successfully
transmitted.
progress_args (``tuple``, *optional*): progress_args (``tuple``, *optional*):
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass Extra custom arguments for the progress callback function.
a chat_id and a message_id in order to edit a message with the updated progress. You can pass anything you need to be available in the progress callback scope; for example, a Message
object or a Client instance in order to edit the message with the updated progress status.
Other Parameters: Other Parameters:
client (:obj:`Client`):
The Client itself, useful when you want to call other API methods inside the callback function.
current (``int``): current (``int``):
The amount of bytes uploaded so far. The amount of bytes transmitted so far.
total (``int``): total (``int``):
The size of the file. The total size of the file.
*args (``tuple``, *optional*): *args (``tuple``, *optional*):
Extra custom arguments as defined in the *progress_args* parameter. Extra custom arguments as defined in the *progress_args* parameter.
@ -1286,23 +1284,22 @@ class Message(Object, Update):
instructions to remove reply keyboard or to force a reply from the user. instructions to remove reply keyboard or to force a reply from the user.
progress (``callable``, *optional*): progress (``callable``, *optional*):
Pass a callback function to view the upload progress. Pass a callback function to view the file transmission progress.
The function must take *(client, current, total, \*args)* as positional arguments (look at the section The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
below for a detailed description). detailed description) and will be called back each time a new file chunk has been successfully
transmitted.
progress_args (``tuple``, *optional*): progress_args (``tuple``, *optional*):
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass Extra custom arguments for the progress callback function.
a chat_id and a message_id in order to edit a message with the updated progress. You can pass anything you need to be available in the progress callback scope; for example, a Message
object or a Client instance in order to edit the message with the updated progress status.
Other Parameters: Other Parameters:
client (:obj:`Client`):
The Client itself, useful when you want to call other API methods inside the callback function.
current (``int``): current (``int``):
The amount of bytes uploaded so far. The amount of bytes transmitted so far.
total (``int``): total (``int``):
The size of the file. The total size of the file.
*args (``tuple``, *optional*): *args (``tuple``, *optional*):
Extra custom arguments as defined in the *progress_args* parameter. Extra custom arguments as defined in the *progress_args* parameter.
@ -1681,23 +1678,22 @@ class Message(Object, Update):
instructions to remove reply keyboard or to force a reply from the user. instructions to remove reply keyboard or to force a reply from the user.
progress (``callable``, *optional*): progress (``callable``, *optional*):
Pass a callback function to view the upload progress. Pass a callback function to view the file transmission progress.
The function must take *(client, current, total, \*args)* as positional arguments (look at the section The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
below for a detailed description). detailed description) and will be called back each time a new file chunk has been successfully
transmitted.
progress_args (``tuple``, *optional*): progress_args (``tuple``, *optional*):
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass Extra custom arguments for the progress callback function.
a chat_id and a message_id in order to edit a message with the updated progress. You can pass anything you need to be available in the progress callback scope; for example, a Message
object or a Client instance in order to edit the message with the updated progress status.
Other Parameters: Other Parameters:
client (:obj:`Client`):
The Client itself, useful when you want to call other API methods inside the callback function.
current (``int``): current (``int``):
The amount of bytes uploaded so far. The amount of bytes transmitted so far.
total (``int``): total (``int``):
The size of the file. The total size of the file.
*args (``tuple``, *optional*): *args (``tuple``, *optional*):
Extra custom arguments as defined in the *progress_args* parameter. Extra custom arguments as defined in the *progress_args* parameter.
@ -1859,23 +1855,22 @@ class Message(Object, Update):
instructions to remove reply keyboard or to force a reply from the user. instructions to remove reply keyboard or to force a reply from the user.
progress (``callable``, *optional*): progress (``callable``, *optional*):
Pass a callback function to view the upload progress. Pass a callback function to view the file transmission progress.
The function must take *(client, current, total, \*args)* as positional arguments (look at the section The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
below for a detailed description). detailed description) and will be called back each time a new file chunk has been successfully
transmitted.
progress_args (``tuple``, *optional*): progress_args (``tuple``, *optional*):
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass Extra custom arguments for the progress callback function.
a chat_id and a message_id in order to edit a message with the updated progress. You can pass anything you need to be available in the progress callback scope; for example, a Message
object or a Client instance in order to edit the message with the updated progress status.
Other Parameters: Other Parameters:
client (:obj:`Client`):
The Client itself, useful when you want to call other API methods inside the callback function.
current (``int``): current (``int``):
The amount of bytes uploaded so far. The amount of bytes transmitted so far.
total (``int``): total (``int``):
The size of the file. The total size of the file.
*args (``tuple``, *optional*): *args (``tuple``, *optional*):
Extra custom arguments as defined in the *progress_args* parameter. Extra custom arguments as defined in the *progress_args* parameter.
@ -2092,23 +2087,22 @@ class Message(Object, Update):
instructions to remove reply keyboard or to force a reply from the user. instructions to remove reply keyboard or to force a reply from the user.
progress (``callable``, *optional*): progress (``callable``, *optional*):
Pass a callback function to view the upload progress. Pass a callback function to view the file transmission progress.
The function must take *(client, current, total, \*args)* as positional arguments (look at the section The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
below for a detailed description). detailed description) and will be called back each time a new file chunk has been successfully
transmitted.
progress_args (``tuple``, *optional*): progress_args (``tuple``, *optional*):
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass Extra custom arguments for the progress callback function.
a chat_id and a message_id in order to edit a message with the updated progress. You can pass anything you need to be available in the progress callback scope; for example, a Message
object or a Client instance in order to edit the message with the updated progress status.
Other Parameters: Other Parameters:
client (:obj:`Client`):
The Client itself, useful when you want to call other API methods inside the callback function.
current (``int``): current (``int``):
The amount of bytes uploaded so far. The amount of bytes transmitted so far.
total (``int``): total (``int``):
The size of the file. The total size of the file.
*args (``tuple``, *optional*): *args (``tuple``, *optional*):
Extra custom arguments as defined in the *progress_args* parameter. Extra custom arguments as defined in the *progress_args* parameter.
@ -2214,23 +2208,22 @@ class Message(Object, Update):
instructions to remove reply keyboard or to force a reply from the user. instructions to remove reply keyboard or to force a reply from the user.
progress (``callable``, *optional*): progress (``callable``, *optional*):
Pass a callback function to view the upload progress. Pass a callback function to view the file transmission progress.
The function must take *(client, current, total, \*args)* as positional arguments (look at the section The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
below for a detailed description). detailed description) and will be called back each time a new file chunk has been successfully
transmitted.
progress_args (``tuple``, *optional*): progress_args (``tuple``, *optional*):
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass Extra custom arguments for the progress callback function.
a chat_id and a message_id in order to edit a message with the updated progress. You can pass anything you need to be available in the progress callback scope; for example, a Message
object or a Client instance in order to edit the message with the updated progress status.
Other Parameters: Other Parameters:
client (:obj:`Client`):
The Client itself, useful when you want to call other API methods inside the callback function.
current (``int``): current (``int``):
The amount of bytes uploaded so far. The amount of bytes transmitted so far.
total (``int``): total (``int``):
The size of the file. The total size of the file.
*args (``tuple``, *optional*): *args (``tuple``, *optional*):
Extra custom arguments as defined in the *progress_args* parameter. Extra custom arguments as defined in the *progress_args* parameter.
@ -2333,23 +2326,22 @@ class Message(Object, Update):
instructions to remove reply keyboard or to force a reply from the user. instructions to remove reply keyboard or to force a reply from the user.
progress (``callable``, *optional*): progress (``callable``, *optional*):
Pass a callback function to view the upload progress. Pass a callback function to view the file transmission progress.
The function must take *(client, current, total, \*args)* as positional arguments (look at the section The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
below for a detailed description). detailed description) and will be called back each time a new file chunk has been successfully
transmitted.
progress_args (``tuple``, *optional*): progress_args (``tuple``, *optional*):
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass Extra custom arguments for the progress callback function.
a chat_id and a message_id in order to edit a message with the updated progress. You can pass anything you need to be available in the progress callback scope; for example, a Message
object or a Client instance in order to edit the message with the updated progress status.
Other Parameters: Other Parameters:
client (:obj:`Client`):
The Client itself, useful when you want to call other API methods inside the callback function.
current (``int``): current (``int``):
The amount of bytes uploaded so far. The amount of bytes transmitted so far.
total (``int``): total (``int``):
The size of the file. The total size of the file.
*args (``tuple``, *optional*): *args (``tuple``, *optional*):
Extra custom arguments as defined in the *progress_args* parameter. Extra custom arguments as defined in the *progress_args* parameter.
@ -2619,9 +2611,6 @@ class Message(Object, Update):
if self.game and not self._client.is_bot: if self.game and not self._client.is_bot:
raise ValueError("Users cannot send messages with Game media type") raise ValueError("Users cannot send messages with Game media type")
# TODO: Improve markdown parser. Currently html appears to be more stable, thus we use it here because users
# can"t choose.
if self.text: if self.text:
return self._client.send_message( return self._client.send_message(
chat_id, chat_id,
@ -2900,14 +2889,27 @@ class Message(Object, Update):
Blocks the code execution until the file has been downloaded. Blocks the code execution until the file has been downloaded.
Defaults to True. Defaults to True.
progress (``callable``): progress (``callable``, *optional*):
Pass a callback function to view the download progress. Pass a callback function to view the file transmission progress.
The function must take *(client, current, total, \*args)* as positional arguments (look at the section The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
below for a detailed description). detailed description) and will be called back each time a new file chunk has been successfully
transmitted.
progress_args (``tuple``): progress_args (``tuple``, *optional*):
Extra custom arguments for the progress callback function. Useful, for example, if you want to pass Extra custom arguments for the progress callback function.
a chat_id and a message_id in order to edit a message with the updated progress. You can pass anything you need to be available in the progress callback scope; for example, a Message
object or a Client instance in order to edit the message with the updated progress status.
Other Parameters:
current (``int``):
The amount of bytes transmitted so far.
total (``int``):
The total size of the file.
*args (``tuple``, *optional*):
Extra custom arguments as defined in the *progress_args* parameter.
You can either keep *\*args* or add every single extra argument in your function signature.
Returns: Returns:
On success, the absolute path of the downloaded file as string is returned, None otherwise. On success, the absolute path of the downloaded file as string is returned, None otherwise.