Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert data from GetAuthorizationsRequest to params new client #97

Open
ZherebcovSergey opened this issue Aug 21, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@ZherebcovSergey
Copy link

The situation is that there are several devices that use the Telethon + Opentele API. Is there some way to convert data from:

result = await client(functions.account.GetAuthorizationsRequest())
result = result.__getattribute__('authorizations')

into query parameters to generate a new client?

client = TelegramClient("telethon.session", api=api)
await client.connect()

I noticed that the client's parameters and the response to the request differ in some parameters.

'TelegramAndroid() = {
    api_id: 6
    api_hash: eb06d4abfb49dc3eeb1aeb98ae0f581e
    device_model: Huawei HUAWEI Y516-T00
    system_version: SDK 29
    app_version: 8.4.1 (2522)
    system_lang_code: en-US
    lang_pack: android
    lang_code: en
    pid: 14167883335082106939
}'

but from

GetAuthorizationsRequest()

slightly different data

device_model='Huawei Y516-'
system_version='10 Q (29)'
app_version='8.4.1'
@ZherebcovSergey ZherebcovSergey added the enhancement New feature or request label Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant