Client Settings

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:

  • Device Model: CPython x.y.z

  • Application: Pyrogram x.y.z

  • System Version: Linux x.y.z


Set Custom Values

To set custom values, you can pass the arguments directly in the Client’s constructor.

app = Client(
    "my_account",
    app_version="1.2.3",
    device_model="PC",
    system_version="Linux"
)

Set Custom Languages

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 standard (defaults to “en”, English).

With the following code we make Telegram know we want it to speak in Italian (it):

app = Client(
    "my_account",
    lang_code="it",
)

Decreasing chance of ban

To reduce the chance of your account being banned you should fill in the various optional fields of the client.

Example:

Android

import asyncio

from pyrogram import Client, enums

async def main():
    app = Client(
        "my_account",
        api_id=6,
        api_hash="eb06d4abfb49dc3eeb1aeb98ae0f581e",
        device_model="Samsung SM-S931B", # Should be device MODEL, not name (Samsung Galaxy S24).
        system_version="15 (35)",
        app_version="11.13.2 (60601)",
        lang_pack="android",
        lang_code="jabka",
        client_platform=enums.ClientPlatform.ANDROID # Used for webapps only
    )

    app.run()

asyncio.run(main())

Telegram Desktop

import asyncio

from pyrogram import Client, enums

async def main():
    app = Client(
        "my_account",
        api_id=2040,
        api_hash="b18441a1ff607e10a989891a5462e627",
        device_model="Desktop",
        system_version="Windows 11 x64",
        app_version="6.0.2 x64",
        lang_pack="tdesktop",
        lang_code="jabka",
        client_platform=enums.ClientPlatform.DESKTOP # Used for webapps only
    )

    app.run()

asyncio.run(main())