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
631 stars 117 forks source link

users.getFullUser behaves differently from different login #286

Open bonkor opened 1 year ago

bonkor commented 1 year ago

In script

const api = require('./api.js');
const login = require('./login.js');

(async () => {
  const res = await login();

  try {
    const info = await api.call('users.getFullUser', {
      id: {
        _: 'inputUser',
        user_id: '4*****1',
      },
    });
    console.log(info.users[0]);
  } catch (e) {
    console.log('getFullUser', e);
  }

})();

where api.js is from https://mtproto-core.js.org/docs/setup-handle-errors and login.js is from https://mtproto-core.js.org/docs/user-authorization users.getFullUser works good. If I change phone, code in login.js (and api_id, apihash in api.js) to my second phone,code,id,hash - users.getFullUser rise error: { : 'mt_rpc_error', error_code: 400, error_message: 'USER_ID_INVALID' } How to fix it?