tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.07k stars 1.44k forks source link

[tdlib_json] tdjson_example.py #1781

Closed andrew-phi closed 2 years ago

andrew-phi commented 2 years ago

Running python client example always gives an error after entering phone number:

Please enter your phone number: +xxx
{u'@type': u'updateAuthorizationState', u'authorization_state': {u'@type': u'authorizationStateWaitPhoneNumber'}, u'@client_id': 1}
{u'@type': u'ok', u'@client_id': 1}
{u'for_dark_theme': False, u'@type': u'updateSelectedBackground', u'@client_id': 1}
{u'for_dark_theme': True, u'@type': u'updateSelectedBackground', u'@client_id': 1}
{u'state': {u'@type': u'connectionStateConnecting'}, u'@type': u'updateConnectionState', u'@client_id': 1}
{u'emojis': [u'\U0001f44d', u'\U0001f618', u'\U0001f60d', u'\U0001f621', u'\U0001f973', u'\U0001f602', u'\U0001f62e', u'\U0001f644', u'\U0001f60e', u'\U0001f44e'], u'@client_id': 1, u'@type': u'updateAnimationSearchParameters', u'provider': u'tenor'}
{u'state': {u'@type': u'connectionStateReady'}, u'@type': u'updateConnectionState', u'@client_id': 1}
{u'message': u'Failed to parse JSON object as TDLib request: Expected String, got Number', u'code': 400, u'@type': u'error', u'@client_id': 1}

The problem probably lies in "password" authentication - the C++ client ASKS for it, python client does not. I spent days figuring that out! PS: until your areshowl managers (or officers in charge :D) remove phone numbers requirement, telegram is garbage.

levlam commented 2 years ago

There are no issues in the example.