Further clarify the documentation (flood wait, lists and inputs)

This commit is contained in:
Lonami Exo 2018-02-14 14:06:45 +01:00
parent 55bcc29ae0
commit e9dd93f09c
3 changed files with 21 additions and 1 deletions

View File

@ -207,6 +207,13 @@ def get_description(arg):
desc.append('This argument can be omitted.') desc.append('This argument can be omitted.')
otherwise = True otherwise = True
if arg.type in {'InputPeer', 'InputUser', 'InputChannel'}:
desc.append(
'Anything entity-like will work if the library can find its '
'<code>Input</code> version (e.g., usernames, <code>Peer</code>, '
'<code>User</code> or <code>Channel</code> objects, etc.).'
)
if arg.is_vector: if arg.is_vector:
if arg.is_generic: if arg.is_generic:
desc.append('A list of other Requests must be supplied.') desc.append('A list of other Requests must be supplied.')
@ -221,7 +228,11 @@ def get_description(arg):
desc.insert(1, 'Otherwise,') desc.insert(1, 'Otherwise,')
desc[-1] = desc[-1][:1].lower() + desc[-1][1:] desc[-1] = desc[-1][:1].lower() + desc[-1][1:]
return ' '.join(desc) return ' '.join(desc).replace(
'list',
'<span class="tooltip" title="Any iterable that supports len() '
'will work too">list</span>'
)
def copy_replace(src, dst, replacements): def copy_replace(src, dst, replacements):

View File

@ -108,6 +108,10 @@ span.sh4 {
color: #06c; color: #06c;
} }
span.tooltip {
border-bottom: 1px dashed #444;
}
#searchBox { #searchBox {
width: 100%; width: 100%;
border: none; border: none;

View File

@ -95,6 +95,11 @@ is just a matter of taste, and how much control you need.
Remember that you can get yourself at any time with ``client.get_me()``. Remember that you can get yourself at any time with ``client.get_me()``.
.. warning::
Please note that if you fail to login around 5 times (or change the first
parameter of the ``TelegramClient``, which is the session name) you will
receive a ``FloodWaitError`` of around 22 hours, so be careful not to mess
this up! This shouldn't happen if you're doing things as explained, though.
.. note:: .. note::
If you want to use a **proxy**, you have to `install PySocks`__ If you want to use a **proxy**, you have to `install PySocks`__