Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

users.getFullUser behaves differently from different login #286

Open
bonkor opened this issue Aug 21, 2023 · 0 comments
Open

users.getFullUser behaves differently from different login #286

bonkor opened this issue Aug 21, 2023 · 0 comments

Comments

@bonkor
Copy link

bonkor commented Aug 21, 2023

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, api_hash 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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant