mtproto-core
mtproto-core copied to clipboard
Cannot read property 'call' of undefined
I'm trying to get an user:
user_id = parseInt(warnList[0]["staffer"])
console.log("ID:", user_id)
staffer = await api.call('users.getFullUser', {id: user_id});
console.log(staffer)
Below what is printed by console.log("ID:", user_id)
:
ID: 935648014
I'm getting this error:
users.getFullUser error: TypeError: Cannot read property 'call' of undefined
Maybe this issue is caused due to a bad parameter. However i have no idea about the right parameter to use. Help would be appreciated
Param id's type need to be InputUser, not int https://core.telegram.org/method/users.getFullUser https://core.telegram.org/type/InputUser https://core.telegram.org/constructor/inputUser
e.g. inputUserSelf
const user_info = await api.call('users.getFullUser', { id: { _: 'inputUserSelf' } }) console.log(user_info);
inputUser
const user_info = await api.call('users.getFullUser', { id: { _: 'inputUser', user_id: 94032407, access_hash: 'access_hash value from the User constructor', } }) console.log(user_info);