538f1e3972
- Pyrogram core is now fully asynchronous - Ditched Python 3.5, welcome 3.6 as minimum version. - Moved all types to pyrogram.types - Turned the Filters class into a module (filters) - Moved all filters to pyrogram.filters - Moved all handlers to pyrogram.handlers - Moved all emoji to pyrogram.emoji - Renamed pyrogram.api to pyrogram.raw - Clock is now synced with server's time - Telegram schema updated to Layer 117 - Greatly improved the TL compiler (proper type-constructor hierarchy) - Added "do not edit" warning in generated files - Crypto parts are executed in a thread pool to avoid blocking the event loop - idle() is now a separate function (it doesn't deal with Client instances) - Async storage, async filters and async progress callback (optional, can be sync too) - Added getpass back, for hidden password inputs
47 lines
1.7 KiB
ReStructuredText
47 lines
1.7 KiB
ReStructuredText
Test Servers
|
|
============
|
|
|
|
If you wish to test your application in a separate environment, Pyrogram is able to authorize your account into
|
|
Telegram's test servers without hassle. All you need to do is start a new session (e.g.: "my_account_test") using
|
|
``test_mode=True``:
|
|
|
|
.. code-block:: python
|
|
|
|
from pyrogram import Client
|
|
|
|
with Client("my_account_test", test_mode=True) as app:
|
|
print(app.get_me())
|
|
|
|
.. note::
|
|
|
|
If this is the first time you login into test servers, you will be asked to register your account first.
|
|
Don't worry about your contacts and chats, they will be kept untouched inside the production environment;
|
|
accounts authorized on test servers reside in a different, parallel instance of a Telegram database.
|
|
|
|
.. contents:: Contents
|
|
:backlinks: none
|
|
:depth: 1
|
|
:local:
|
|
|
|
-----
|
|
|
|
Test Mode in Official Apps
|
|
--------------------------
|
|
|
|
You can also login yourself into test servers using official desktop apps, such as Webogram and TDesktop:
|
|
|
|
- **Webogram**: Login here: https://web.telegram.org/?test=1
|
|
- **TDesktop**: Hold ``Alt+Shift`` and right click on "Add account", then choose "Test server".
|
|
|
|
Test Numbers
|
|
------------
|
|
|
|
Beside normal numbers, the test environment allows you to login with reserved test numbers.
|
|
Valid phone numbers follow the pattern ``99966XYYYY``, where ``X`` is the DC number (1 to 3) and ``YYYY`` are random
|
|
numbers. Users with such numbers always get ``XXXXX`` as the confirmation code (the DC number, repeated five times).
|
|
|
|
.. important::
|
|
|
|
Do not store any important or private information in such test users' accounts; anyone can make use of the
|
|
simplified authorization mechanism and login at any time.
|