mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Update README.rst
This commit is contained in:
parent
7c84c72f06
commit
6e1798d6ac
38
README.rst
38
README.rst
|
@ -1,11 +1,17 @@
|
||||||
Telethon
|
Telethon
|
||||||
========
|
========
|
||||||
**Telethon** is Telegram client implementation in Python which uses the latest available API of Telegram.
|
.. epigraph::
|
||||||
The project's **core only** is based on TLSharp, a C# Telegram client implementation.
|
|
||||||
|
⭐️ Thanks **everyone** who has starred the project, it means a lot!
|
||||||
|
|
||||||
|
**Telethon** is Telegram client implementation in **Python** which uses the latest available API of Telegram.
|
||||||
|
|
||||||
Before opening an issue about how to use the library, **please** make sure you have read and followed
|
Before opening an issue about how to use the library, **please** make sure you have read and followed
|
||||||
the steps mentioned under `Using Telethon`_! A lot of people ask simple questions which will only
|
the steps mentioned under `Using Telethon`_ and are using the latest version! A lot of people ask simple
|
||||||
be answered as "please see the ``README.rst``". And you should use the search before posting an issue, too.
|
questions which will only be answered as "please see the ``README.rst``". And you should use the search
|
||||||
|
before posting an issue, too.
|
||||||
|
|
||||||
|
If you come here often, you may want to go to the `docs <https://lonamiwebs.github.io/Telethon>`_.
|
||||||
|
|
||||||
.. contents:: Table of contents
|
.. contents:: Table of contents
|
||||||
|
|
||||||
|
@ -43,6 +49,7 @@ Now that you know your ``API ID`` and ``Hash``, you can continue installing Tele
|
||||||
|
|
||||||
Installing Telethon
|
Installing Telethon
|
||||||
===================
|
===================
|
||||||
|
|
||||||
Installing Telethon via ``pip``
|
Installing Telethon via ``pip``
|
||||||
-------------------------------
|
-------------------------------
|
||||||
On a terminal, issue the following command:
|
On a terminal, issue the following command:
|
||||||
|
@ -51,7 +58,11 @@ On a terminal, issue the following command:
|
||||||
|
|
||||||
sudo -H pip install telethon
|
sudo -H pip install telethon
|
||||||
|
|
||||||
You're ready to go.
|
You're ready to go. Oh, and upgrading is just as easy:
|
||||||
|
|
||||||
|
.. code:: sh
|
||||||
|
|
||||||
|
sudo -H pip install --upgrade telethon
|
||||||
|
|
||||||
Installing Telethon manually
|
Installing Telethon manually
|
||||||
----------------------------
|
----------------------------
|
||||||
|
@ -111,6 +122,17 @@ disposal, please check the
|
||||||
`official Telethon documentation <https://lonamiwebs.github.io/Telethon>`_.
|
`official Telethon documentation <https://lonamiwebs.github.io/Telethon>`_.
|
||||||
There you'll find a list of all the methods, types and available constructors.
|
There you'll find a list of all the methods, types and available constructors.
|
||||||
|
|
||||||
|
Common errors
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Some errors you may encounter when using Telethon can be the ``FloodWaitError``, which tells you
|
||||||
|
that you've been trying to send the very same request many times, too quickly. You must wait
|
||||||
|
``flood_wait_error.seconds`` before calling ``client.connect()`` again, since this error also
|
||||||
|
disconnects the client.
|
||||||
|
|
||||||
|
Another common one is the ``RPCError``, which usually has descriptive information on what went wrong.
|
||||||
|
However, you may encounter something strange. If you don't manage to solve it, please open an issue.
|
||||||
|
|
||||||
Advanced uses
|
Advanced uses
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
@ -214,3 +236,9 @@ Once this is done, pass the proxy settings to the ``TelegramClient`` constructor
|
||||||
|
|
||||||
The ``proxy=`` parameter should be a tuple consisting of
|
The ``proxy=`` parameter should be a tuple consisting of
|
||||||
``(type, 'ip address', port)``, as described `here <https://github.com/Anorov/PySocks#sockssocksocket>`_.
|
``(type, 'ip address', port)``, as described `here <https://github.com/Anorov/PySocks#sockssocksocket>`_.
|
||||||
|
|
||||||
|
Disclaimer
|
||||||
|
==========
|
||||||
|
|
||||||
|
This project was originally an implementation from TLSharp (a C# library for the Telegram API),
|
||||||
|
but since then, the project has evolved a lot on its own.
|
|
@ -215,7 +215,6 @@ class TelegramClient:
|
||||||
return self.invoke(request, timeout=timeout, throw_invalid_dc=True)
|
return self.invoke(request, timeout=timeout, throw_invalid_dc=True)
|
||||||
|
|
||||||
except FloodWaitError:
|
except FloodWaitError:
|
||||||
# TODO Write somewhere that FloodWaitError disconnects the client
|
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user