gramjs
gramjs copied to clipboard
How to get user info and join to channel , Error PeerUser
i'am request
(async function run() {
await client.connect(); // This assumes you have already authenticated with .start()
const result = await client.invoke(
new Api.channels.GetParticipants({
channel: "pocoitaliaufficiale",
filter: new Api.ChannelParticipantsRecent({}),
offset: 0,
limit: 5,
hash: 0,
})
);
console.log(result); // prints the result
res.send(result);
})();
and i will json result
"users": [
{
"flags": 33570859,
"self": false,
"contact": false,
"mutualContact": false,
"deleted": false,
"bot": true,
"botChatHistory": false,
"botNochats": false,
"verified": false,
"restricted": false,
"min": false,
"botInlineGeo": false,
"support": false,
"scam": false,
"applyMinPhoto": true,
"fake": false,
"botAttachMenu": false,
"id": "689374041",
"accessHash": "4621180786052717638",
"firstName": "Community Help",
"lastName": null,
"username": "Android_Applicant_bot",
"phone": null,
"status": null,
"botInfoVersion": 1,
"restrictionReason": null,
"botInlinePlaceholder": null,
"langCode": null,
"className": "User"
},
and i will request info by userid 689374041
(async function run() {
await client.connect(); // This assumes you have already authenticated with .start()
const result = await client.invoke(
new Api.users.GetFullUser({
id: "689374041",
})
);
console.log(result); // prints the result
})();
but error Error: Could not find the input entity for {"userId":"689374041","className":"PeerUser"}.
i want to userid 689374041 join to channel
(async function run() {
await client.connect(); // This assumes you have already authenticated with .start()
const result = await client.invoke(
new Api.channels.InviteToChannel({
channel: "testinvitechannel",
users: ["689374041"],
})
);
console.log(result); // prints the result
})();
but error Error: Could not find the input entity for {"userId":"689374041","className":"PeerUser"}.
How can? please.. Help. Thanks
Hey man, same problem. Did you find a solution?