mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Further clarify things in the documentation
This commit is contained in:
parent
9322c37a94
commit
7249d01709
|
@ -48,8 +48,12 @@ by setting ``client.session.save_entities = False``.
|
|||
Different Session Storage
|
||||
=========================
|
||||
|
||||
If you don't want to use the default SQLite session storage, you can also use
|
||||
one of the other implementations or implement your own storage.
|
||||
If you don't want to use the default SQLite session storage, you can also
|
||||
use one of the other implementations or implement your own storage.
|
||||
|
||||
While it's often not the case, it's possible that SQLite is slow enough to
|
||||
be noticeable, in which case you can also use a different storage. Note that
|
||||
this is rare and most people won't have this issue, but it's worth a mention.
|
||||
|
||||
To use a custom session storage, simply pass the custom session instance to
|
||||
:ref:`TelegramClient <telethon-client>` instead of
|
||||
|
|
|
@ -45,3 +45,7 @@ an index so that they can be imported easily.
|
|||
|
||||
Custom documentation can also be generated to easily navigate through
|
||||
the vast amount of items offered by the API.
|
||||
|
||||
If you clone the repository, you will have to run ``python setup.py gen``
|
||||
in order to generate the code. Installing the library runs the generator
|
||||
too, but the mentioned command will just generate code.
|
||||
|
|
|
@ -215,6 +215,27 @@ alternative to `Flask <flask.pocoo.org/>`_.
|
|||
|
||||
Check out `quart_login.py`_ for an example web-application based on Quart.
|
||||
|
||||
Can I use Anaconda/Spyder/IPython with the library?
|
||||
===================================================
|
||||
|
||||
Yes, but these interpreters run the asyncio event loop implicitly,
|
||||
which interferes with the ``telethon.sync`` magic module.
|
||||
|
||||
If you use them, you should **not** import ``sync``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# Change any of these...:
|
||||
from telethon import TelegramClient, sync, ...
|
||||
from telethon.sync import TelegramClient, ...
|
||||
|
||||
# ...with this:
|
||||
from telethon import TelegramClient, ...
|
||||
|
||||
You are also more likely to get "sqlite3.OperationalError: database is locked"
|
||||
with them. If they cause too much trouble, just write your code in a ``.py``
|
||||
file and run that, or use the normal ``python`` interpreter.
|
||||
|
||||
.. _logging: https://docs.python.org/3/library/logging.html
|
||||
.. _@SpamBot: https://t.me/SpamBot
|
||||
.. _issue 297: https://github.com/LonamiWebs/Telethon/issues/297
|
||||
|
|
Loading…
Reference in New Issue
Block a user