Merge branch 'master' into docs
This commit is contained in:
commit
0180c19d29
@ -66,7 +66,7 @@ class Client:
|
|||||||
to save the session to a file named ``<session_name>.session``.
|
to save the session to a file named ``<session_name>.session``.
|
||||||
|
|
||||||
test_mode (:obj:`bool`, optional):
|
test_mode (:obj:`bool`, optional):
|
||||||
Enable or disable log-in to testing servers. Defaults to ``False``.
|
Enable or disable log-in to testing servers. Defaults to False.
|
||||||
Only applicable for new sessions and will be ignored in case previously
|
Only applicable for new sessions and will be ignored in case previously
|
||||||
created sessions are loaded.
|
created sessions are loaded.
|
||||||
"""
|
"""
|
||||||
@ -111,9 +111,9 @@ class Client:
|
|||||||
self.user_id = self.authorize()
|
self.user_id = self.authorize()
|
||||||
self.save_session()
|
self.save_session()
|
||||||
|
|
||||||
self.session.update_handler = self.update_handler
|
|
||||||
self.rnd_id = self.session.msg_id
|
self.rnd_id = self.session.msg_id
|
||||||
self.get_dialogs()
|
self.get_dialogs()
|
||||||
|
self.session.update_handler = self.update_handler
|
||||||
|
|
||||||
mimetypes.init()
|
mimetypes.init()
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ class Client:
|
|||||||
Args:
|
Args:
|
||||||
stop_signals (:obj:`tuple`, optional):
|
stop_signals (:obj:`tuple`, optional):
|
||||||
Iterable containing signals the signal handler will listen to.
|
Iterable containing signals the signal handler will listen to.
|
||||||
Defaults to ``(SIGINT, SIGTERM, SIGABRT)``.
|
Defaults to (SIGINT, SIGTERM, SIGABRT).
|
||||||
"""
|
"""
|
||||||
for s in stop_signals:
|
for s in stop_signals:
|
||||||
signal(s, self.signal_handler)
|
signal(s, self.signal_handler)
|
||||||
@ -466,7 +466,7 @@ class Client:
|
|||||||
"""Use this method to send text messages.
|
"""Use this method to send text messages.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -509,12 +509,12 @@ class Client:
|
|||||||
"""Use this method to forward messages of any kind.
|
"""Use this method to forward messages of any kind.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
|
|
||||||
from_chat_id (:obj:`int` or :obj:`str`):
|
from_chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the chat where the original message was sent
|
Unique identifier for the chat where the original message was sent
|
||||||
(or channel/supergroup username in the format @username). For your personal cloud
|
(or channel/supergroup username in the format @username). For your personal cloud
|
||||||
storage (Saved Messages) you can simply use "me" or "self".
|
storage (Saved Messages) you can simply use "me" or "self".
|
||||||
@ -552,7 +552,7 @@ class Client:
|
|||||||
"""Use this method to send photos.
|
"""Use this method to send photos.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -618,7 +618,7 @@ class Client:
|
|||||||
For sending voice messages, use the :obj:`send_voice` method instead.
|
For sending voice messages, use the :obj:`send_voice` method instead.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -691,7 +691,7 @@ class Client:
|
|||||||
"""Use this method to send general files.
|
"""Use this method to send general files.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -753,7 +753,7 @@ class Client:
|
|||||||
"""Use this method to send video files.
|
"""Use this method to send video files.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -826,7 +826,7 @@ class Client:
|
|||||||
"""Use this method to send audio files.
|
"""Use this method to send audio files.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -892,7 +892,7 @@ class Client:
|
|||||||
"""Use this method to send video messages.
|
"""Use this method to send video messages.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -959,7 +959,7 @@ class Client:
|
|||||||
"""Use this method to send points on the map.
|
"""Use this method to send points on the map.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -1010,7 +1010,7 @@ class Client:
|
|||||||
"""Use this method to send information about a venue.
|
"""Use this method to send information about a venue.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -1073,7 +1073,7 @@ class Client:
|
|||||||
"""Use this method to send phone contacts.
|
"""Use this method to send phone contacts.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -1121,7 +1121,7 @@ class Client:
|
|||||||
"""Use this method when you need to tell the other party that something is happening on your side.
|
"""Use this method when you need to tell the other party that something is happening on your side.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -1151,7 +1151,7 @@ class Client:
|
|||||||
"""Use this method to get a list of profile pictures for a user.
|
"""Use this method to get a list of profile pictures for a user.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
user_id (:obj:`int` or :obj:`str`):
|
user_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier of the target user.
|
Unique identifier of the target user.
|
||||||
|
|
||||||
offset (:obj:`int`, optional):
|
offset (:obj:`int`, optional):
|
||||||
@ -1182,7 +1182,7 @@ class Client:
|
|||||||
"""Use this method to edit text messages.
|
"""Use this method to edit text messages.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -1215,7 +1215,7 @@ class Client:
|
|||||||
"""Use this method to edit captions of messages.
|
"""Use this method to edit captions of messages.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -1250,7 +1250,7 @@ class Client:
|
|||||||
- If the user has *can_delete_messages* permission in a supergroup or a channel, it can delete any message there.
|
- If the user has *can_delete_messages* permission in a supergroup or a channel, it can delete any message there.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
(in the format @username). For your personal cloud storage (Saved Messages) you can
|
||||||
simply use "me" or "self".
|
simply use "me" or "self".
|
||||||
@ -1526,7 +1526,7 @@ class Client:
|
|||||||
"""Use this method to leave a group chat or channel.
|
"""Use this method to leave a group chat or channel.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username).
|
(in the format @username).
|
||||||
|
|
||||||
@ -1568,7 +1568,7 @@ class Client:
|
|||||||
The user must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
The user must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
chat_id (:obj:`int` or :obj:`str`):
|
chat_id (:obj:`int` | :obj:`str`):
|
||||||
Unique identifier for the target chat or username of the target channel/supergroup
|
Unique identifier for the target chat or username of the target channel/supergroup
|
||||||
(in the format @username).
|
(in the format @username).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user