mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-06 21:20:22 +03:00
Change sessions.rst formatting to be compliant with codebase's style
This commit is contained in:
parent
fc3f25cd5f
commit
de29141277
|
@ -50,7 +50,7 @@ Sessions and Heroku
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
You probably have a newer version of SQLite installed (>= 3.8.2). Heroku uses
|
You probably have a newer version of SQLite installed (>= 3.8.2). Heroku uses
|
||||||
SQLite 3.7.9 which does not support `WITHOUT ROWID`. So, If you generated your
|
SQLite 3.7.9 which does not support ``WITHOUT ROWID``. So, If you generated your
|
||||||
session file on a system with SQLite >= 3.8.2 your session file will not work
|
session file on a system with SQLite >= 3.8.2 your session file will not work
|
||||||
on Heroku's platform and will throw a corrupted schema error.
|
on Heroku's platform and will throw a corrupted schema error.
|
||||||
|
|
||||||
|
@ -62,9 +62,10 @@ a custom buildpack to install SQLite >= 3.8.2.
|
||||||
Generating Session File on a Heroku Dyno
|
Generating Session File on a Heroku Dyno
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**Do not restart your application Dyno at any point prior to retrieving your
|
.. warning::
|
||||||
session file. Constantly creating new session files from Telegram's API will
|
Do not restart your application Dyno at any point prior to retrieving your
|
||||||
result in a 24 hour rate limit ban**
|
session file. Constantly creating new session files from Telegram's API will
|
||||||
|
result in a 24 hour rate limit ban**
|
||||||
|
|
||||||
Due to Heroku's ephemeral filesystem all dynamically generated
|
Due to Heroku's ephemeral filesystem all dynamically generated
|
||||||
files not part of your applications buildpack or codebase are destroyed upon
|
files not part of your applications buildpack or codebase are destroyed upon
|
||||||
|
@ -75,20 +76,20 @@ Using this scaffolded code we can start the authentication process:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
client = TelegramClient('login.session', api_id, api_hash,
|
client = TelegramClient('login.session', api_id, api_hash,
|
||||||
update_workers = 1, spawn_read_thread = False)
|
update_workers=1, spawn_read_thread=False)
|
||||||
client.start()
|
client.start()
|
||||||
|
|
||||||
At this point your Dyno will crash because you cannot access stdin. Open your
|
At this point your Dyno will crash because you cannot access stdin. Open your
|
||||||
Dyno's control panel on the Heroku website and "run console" from the "More"
|
Dyno's control panel on the Heroku website and "run console" from the "More"
|
||||||
dropdown at the top right. Enter `bash` and wait for it to load.
|
dropdown at the top right. Enter ``bash`` and wait for it to load.
|
||||||
|
|
||||||
You will automatically be placed into your applications working directory.
|
You will automatically be placed into your applications working directory.
|
||||||
So run your application `python app.py` and now you can complete the input
|
So run your application ``python app.py`` and now you can complete the input
|
||||||
requests such as "what is your phone number" etc.
|
requests such as "what is your phone number" etc.
|
||||||
|
|
||||||
Once you're successfully authenticated exit your application script with
|
Once you're successfully authenticated exit your application script with
|
||||||
CTRL + C and `ls` to confirm `login.session` exists in your current directory.
|
CTRL + C and ``ls`` to confirm ``login.session`` exists in your current directory.
|
||||||
Now you can create a git repo on your account and commit `login.session` to
|
Now you can create a git repo on your account and commit ``login.session`` to
|
||||||
that repo.
|
that repo.
|
||||||
|
|
||||||
You cannot ssh into your Dyno instance because it has crashed, so unless you
|
You cannot ssh into your Dyno instance because it has crashed, so unless you
|
||||||
|
|
Loading…
Reference in New Issue
Block a user