mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 12:59:46 +00:00
Clean up and complete RTD documentation
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
=========================================
|
||||
========================================
|
||||
Deleted, Limited or Deactivated Accounts
|
||||
=========================================
|
||||
========================================
|
||||
|
||||
If you're from Iran or Russian, we have bad news for you.
|
||||
Telegram is much more likely to ban these numbers,
|
||||
@@ -23,4 +23,4 @@ For more discussion, please see `issue 297`__.
|
||||
|
||||
|
||||
__ https://t.me/SpamBot
|
||||
__ https://github.com/LonamiWebs/Telethon/issues/297
|
||||
__ https://github.com/LonamiWebs/Telethon/issues/297
|
||||
|
@@ -1,15 +1,18 @@
|
||||
================
|
||||
Enable Logging
|
||||
Enabling Logging
|
||||
================
|
||||
|
||||
Telethon makes use of the `logging`__ module, and you can enable it as follows:
|
||||
|
||||
.. code-block:: python
|
||||
.. code:: python
|
||||
|
||||
import logging
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
import logging
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
You can also use it in your own project very easily:
|
||||
The library has the `NullHandler`__ added by default so that no log calls
|
||||
will be printed unless you explicitly enable it.
|
||||
|
||||
You can also `use the module`__ on your own project very easily:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -21,4 +24,17 @@ You can also use it in your own project very easily:
|
||||
logger.warning('This is a warning!')
|
||||
|
||||
|
||||
__ https://docs.python.org/3/library/logging.html
|
||||
If you want to enable ``logging`` for your project *but* use a different
|
||||
log level for the library:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import logging
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
# For instance, show only warnings and above
|
||||
logging.getLogger('telethon').setLevel(level=logging.WARNING)
|
||||
|
||||
|
||||
__ https://docs.python.org/3/library/logging.html
|
||||
__ https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
|
||||
__ https://docs.python.org/3/howto/logging.html
|
||||
|
@@ -3,9 +3,9 @@ RPC Errors
|
||||
==========
|
||||
|
||||
RPC stands for Remote Procedure Call, and when Telethon raises an
|
||||
``RPCError``, it’s most likely because you have invoked some of the API
|
||||
``RPCError``, it's most likely because you have invoked some of the API
|
||||
methods incorrectly (wrong parameters, wrong permissions, or even
|
||||
something went wrong on Telegram’s server). The most common are:
|
||||
something went wrong on Telegram's server). The most common are:
|
||||
|
||||
- ``FloodError`` (420), the same request was repeated many times. Must
|
||||
wait ``.seconds``.
|
||||
@@ -13,7 +13,7 @@ something went wrong on Telegram’s server). The most common are:
|
||||
verification on Telegram.
|
||||
- ``CdnFileTamperedError``, if the media you were trying to download
|
||||
from a CDN has been altered.
|
||||
- ``ChatAdminRequiredError``, you don’t have permissions to perform
|
||||
- ``ChatAdminRequiredError``, you don't have permissions to perform
|
||||
said operation on a chat or channel. Try avoiding filters, i.e. when
|
||||
searching messages.
|
||||
|
||||
@@ -22,6 +22,6 @@ The generic classes for different error codes are: \* ``InvalidDCError``
|
||||
``BadRequestError`` (400), the request contained errors. \*
|
||||
``UnauthorizedError`` (401), the user is not authorized yet. \*
|
||||
``ForbiddenError`` (403), privacy violation error. \* ``NotFoundError``
|
||||
(404), make sure you’re invoking ``Request``\ ’s!
|
||||
(404), make sure you're invoking ``Request``\ 's!
|
||||
|
||||
If the error is not recognised, it will only be an ``RPCError``.
|
||||
If the error is not recognised, it will only be an ``RPCError``.
|
||||
|
Reference in New Issue
Block a user