alik0211 / mtproto-core

Telegram API JS (MTProto) client library for Node.js and browser
https://mtproto-core.js.org
GNU General Public License v3.0
630 stars 113 forks source link

Update layer to 133 #219

Closed pogudin-sergey closed 2 years ago

pogudin-sergey commented 2 years ago

Fix UDPATE_APP_TO_LOGIN & up layer to133

freeman69rus commented 2 years ago

I am getting this error

if (message.result._ === 'mt_rpc_error') {

TypeError: Cannot read property '_' of undefined

in rpc\index.js:549

pogudin-sergey commented 2 years ago

I am getting this error

if (message.result._ === 'mt_rpcerror') { TypeError: Cannot read property '' of undefined

in rpc\index.js:549

How repeat this case?

alik0211 commented 2 years ago

Thanks! ❤️

pogudin-sergey commented 2 years ago

Thanks! ❤️

Please, up version for npm

alik0211 commented 2 years ago

@pogudin-sergey done

pogudin-sergey commented 2 years ago

@pogudin-sergey done

Thank you!

freeman69rus commented 2 years ago

I am getting this error

if (message.result._ === 'mt_rpcerror') { TypeError: Cannot read property '' of undefined

in rpc\index.js:549

How repeat this case?

call auth.signIn method

pogudin-sergey commented 2 years ago

call auth.signIn method

Look params in you call method. Params do not have "_" key. This is not layer problem.

freeman69rus commented 2 years ago

Look params in you call method. Params do not have "_" key. This is not layer problem.

Everything worked fine before updating the layer.

I send these params:

phone_code phone_number phone_code_hash

Don't you have a similar problem?

pogudin-sergey commented 2 years ago

Don't you have a similar problem?

No problem for 170 users.

Worked code:

sendCode(phone) {
    return this.mtproto.call(
      'auth.sendCode',
      {
        phone_number: phone,
        api_id: config.telegram.appId,
        api_hash: config.telegram.hash,
        settings: {
          _: 'codeSettings',
          current_number: false,
          allow_app_hash: false,
        },
      }
    );
}

I guess you miss codeSettings. Please post full code.

freeman69rus commented 2 years ago

I guess you miss codeSettings. Please post full code.

I have no problem with auth.sendCode method.

//sendCode
this.api.call('auth.sendCode', {
                phone_number: this.phone,
                settings: {
                    _: 'codeSettings',
                    current_number: false,
                    allow_app_hash: false
                },
            })

//signIn
this.api.call('auth.signIn', {
                phone_code: code,
                phone_number: this.phone,
                phone_code_hash: codeHash,
            }, { syncAuth: true })

I haven't changed my code after updating layer

pogudin-sergey commented 2 years ago

I guess you do not rebuild new tl shemas. Run scripts in ./node_modules/@mtproto/core directory:

# npm run generate-builder
# npm run generate-parser
freeman69rus commented 2 years ago

I guess you do not rebuild new tl shemas.

Thanks, this is work!!!!!!!!!!! But I just installed new version via npm and I didn't have a scripts folder.

pogudin-sergey commented 2 years ago

But I just installed new version via npm and I didn't have a scripts folder.

Fix https://github.com/alik0211/mtproto-core/pull/221

Please like )))