mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 04:52:30 +00:00
add a bunch more readthedocs from wiki
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
=========================================
|
||||
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,
|
||||
as they are often used to spam other accounts,
|
||||
likely through the use of libraries like this one.
|
||||
The best advice we can give you is to not abuse the API,
|
||||
like calling many requests really quickly,
|
||||
and to sign up with these phones through an official application.
|
||||
|
||||
Telegram may also ban virtual (VoIP) phone numbers,
|
||||
as again, they're likely to be used for spam.
|
||||
|
||||
If you want to check if your account has been limited,
|
||||
simply send a private message to `@SpamBot`__ through Telegram itself.
|
||||
You should notice this by getting errors like ``PeerFloodError``,
|
||||
which means you're limited, for instance,
|
||||
when sending a message to some accounts but not others.
|
||||
|
||||
For more discussion, please see `issue 297`__.
|
||||
|
||||
|
||||
__ https://t.me/SpamBot
|
||||
__ https://github.com/LonamiWebs/Telethon/issues/297
|
24
readthedocs/extra/troubleshooting/enable-logging.rst
Normal file
24
readthedocs/extra/troubleshooting/enable-logging.rst
Normal file
@@ -0,0 +1,24 @@
|
||||
================
|
||||
Enable Logging
|
||||
================
|
||||
|
||||
Telethon makes use of the `logging`__ module, and you can enable it as follows:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import logging
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
You can also use it in your own project very easily:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
logger.debug('Debug messages')
|
||||
logger.info('Useful information')
|
||||
logger.warning('This is a warning!')
|
||||
|
||||
|
||||
__ https://docs.python.org/3/library/logging.html
|
27
readthedocs/extra/troubleshooting/rpc-errors.rst
Normal file
27
readthedocs/extra/troubleshooting/rpc-errors.rst
Normal file
@@ -0,0 +1,27 @@
|
||||
==========
|
||||
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
|
||||
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``.
|
||||
- ``SessionPasswordNeededError``, if you have setup two-steps
|
||||
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
|
||||
said operation on a chat or channel. Try avoiding filters, i.e. when
|
||||
searching messages.
|
||||
|
||||
The generic classes for different error codes are: \* ``InvalidDCError``
|
||||
(303), the request must be repeated on another DC. \*
|
||||
``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!
|
||||
|
||||
If the error is not recognised, it will only be an ``RPCError``.
|
Reference in New Issue
Block a user