MTPyroger/docs/source/topics/client-settings.rst

60 lines
1.3 KiB
ReStructuredText
Raw Normal View History

2022-01-07 09:18:51 +00:00
Client Settings
===============
2018-06-25 16:06:00 +00:00
2022-01-07 09:18:51 +00:00
You can control the way your client appears in the Active Sessions menu of an official client by changing some client
settings. By default you will see something like the following:
2018-06-25 16:06:00 +00:00
2022-01-07 09:18:51 +00:00
- Device Model: ``CPython x.y.z``
- Application: ``Pyrogram x.y.z``
- System Version: ``Linux x.y.z``
2018-06-25 16:06:00 +00:00
2020-04-01 18:08:46 +00:00
.. contents:: Contents
:backlinks: none
:depth: 1
2020-04-01 18:08:46 +00:00
:local:
-----
2018-06-25 16:06:00 +00:00
Set Custom Values
-----------------
To set custom values, you can either make use of the ``config.ini`` file, this way:
.. code-block:: ini
[pyrogram]
app_version = 1.2.3
device_model = PC
system_version = Linux
Or, pass the arguments directly in the Client's constructor.
.. code-block:: python
app = Client(
"my_account",
app_version="1.2.3",
device_model="PC",
system_version="Linux"
)
Set Custom Languages
--------------------
2018-06-27 12:45:56 +00:00
To tell Telegram in which language should speak to you (terms of service, bots, service messages, ...) you can
set ``lang_code`` in `ISO 639-1 <https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes>`_ standard (defaults to "en",
English).
2018-06-25 16:06:00 +00:00
With the following code we make Telegram know we want it to speak in Italian (it):
.. code-block:: ini
[pyrogram]
lang_code = it
.. code-block:: python
app = Client(
"my_account",
lang_code="it",
)