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
625 stars 111 forks source link

INPUT_METHOD_INVALID #258

Closed freeman69rus closed 2 years ago

freeman69rus commented 2 years ago

When i try to call "channels.joinChannel" method I get this error:

{
  _: 'mt_rpc_error',
  error_code: 400,
  error_message: 'INPUT_METHOD_INVALID_4082822184_2111303'
}

Could it depends on TL-schema?

const channel = await api.call('contacts.resolveUsername', {username: 'username'})
api.call('channels.joinChannel', {
            _: 'inputChannel',
            channel_id: channel.peer.channel_id,
            access_hash: channel.chats.access_hash
})
iezverev commented 2 years ago

I getting this error too @pogudin-sergey @alik0211 what could be causing this error, if you know?

freeman69rus commented 2 years ago

Problem resolved, correct call options:

{
        channel: {
            _: 'inputChannel',
            channel_id: channelPeer.peer.channel_id,
            access_hash: channelPeer.chats[0].access_hash
        }
}

Please. add TS support