Clean up some more twirks on RTD and update docstrings

This commit is contained in:
Lonami Exo
2018-01-05 13:30:21 +01:00
parent 9635a57683
commit a489b4b18b
8 changed files with 307 additions and 205 deletions

View File

@@ -98,7 +98,7 @@ Two Factor Authorization (2FA)
If you have Two Factor Authorization (from now on, 2FA) enabled on your
account, calling :meth:`telethon.TelegramClient.sign_in` will raise a
`SessionPasswordNeededError`. When this happens, just
``SessionPasswordNeededError``. When this happens, just
:meth:`telethon.TelegramClient.sign_in` again with a ``password=``:
.. code-block:: python
@@ -113,7 +113,7 @@ account, calling :meth:`telethon.TelegramClient.sign_in` will raise a
client.sign_in(password=getpass.getpass())
If you don't have 2FA enabled, but you would like to do so through Telethon,
If you don't have 2FA enabled, but you would like to do so through the library,
take as example the following code snippet:
.. code-block:: python
@@ -146,4 +146,4 @@ for the tip!
__ https://github.com/Anorov/PySocks#installation
__ https://github.com/Anorov/PySocks#usage-1%3E
__ https://github.com/Anorov/PySocks#usage-1

View File

@@ -34,22 +34,22 @@ you're able to just do this:
.. code-block:: python
# dialogs are the "conversations you have open"
# this method returns a list of Dialog, which
# have the .entity attribute and other information.
# Dialogs are the "conversations you have open".
# This method returns a list of Dialog, which
# has the .entity attribute and other information.
dialogs = client.get_dialogs(limit=200)
# all of these work and do the same
# All of these work and do the same.
lonami = client.get_entity('lonami')
lonami = client.get_entity('t.me/lonami')
lonami = client.get_entity('https://telegram.dog/lonami')
# other kind of entities
# Other kind of entities.
channel = client.get_entity('telegram.me/joinchat/AAAAAEkk2WdoDrB4-Q8-gg')
contact = client.get_entity('+34xxxxxxxxx')
friend = client.get_entity(friend_id)
# using peers/input peers (note that the API may return these)
# Using Peer/InputPeer (note that the API may return these)
# users, chats and channels may all have the same ID, so it's
# necessary to wrap (at least) chat and channels inside Peer.
from telethon.tl.types import PeerUser, PeerChat, PeerChannel
@@ -79,7 +79,7 @@ possible, making zero API calls most of the time. When a request is made,
if you provided the full entity, e.g. an ``User``, the library will convert
it to the required ``InputPeer`` automatically for you.
**You should always favour ``.get_input_entity()``** over ``.get_entity()``
**You should always favour** ``.get_input_entity()`` **over** ``.get_entity()``
for this reason! Calling the latter will always make an API call to get
the most recent information about said entity, but invoking requests don't
need this information, just the ``InputPeer``. Only use ``.get_entity()``

View File

@@ -50,8 +50,7 @@ Basic Usage
client.send_file('username', '/home/myself/Pictures/holidays.jpg')
client.download_profile_photo(me)
total, messages, senders = client.get_message_history('username')
messages = client.get_message_history('username')
client.download_media(messages[0])
**More details**: :ref:`telegram-client`

View File

@@ -65,4 +65,3 @@ __ https://github.com/ricmoo/pyaes
__ https://pypi.python.org/pypi/pyaes
__ https://github.com/sybrenstuvel/python-rsa/
__ https://pypi.python.org/pypi/rsa/3.4.2
__ https://github.com/LonamiWebs/Telethon/issues/199

View File

@@ -34,7 +34,7 @@ instance through ``curl``. A JSON response will be returned.
curl https://rpc.pwrtelegram.xyz/?for=messages.sendMessage
**Number of ``RPC_CALL_FAIL``\ 's**:
**Number of** ``RPC_CALL_FAIL``:
.. code:: bash

View File

@@ -7,8 +7,8 @@ RPC stands for Remote Procedure Call, and when Telethon raises an
methods incorrectly (wrong parameters, wrong permissions, or even
something went wrong on Telegram's server). The most common are:
- ``FloodError`` (420), the same request was repeated many times. Must
wait ``.seconds``.
- ``FloodWaitError`` (420), the same request was repeated many times.
Must wait ``.seconds`` (you can access this parameter).
- ``SessionPasswordNeededError``, if you have setup two-steps
verification on Telegram.
- ``CdnFileTamperedError``, if the media you were trying to download

View File

@@ -1,3 +1,8 @@
=============
Wall of Shame
=============
This project has an
`issues <https://github.com/LonamiWebs/Telethon/issues>`__ section for
you to file **issues** whenever you encounter any when working with the