Is it possible to remove users from a group? #257
Replies: 2 comments 6 replies
-
Try this for supergroups: await client.invoke(
new Api.channels.EditBanned({
channel: channelId,
participant: userId,
bannedRights: new Api.ChatBannedRights({
untilDate: 0,
viewMessages: true,
sendMessages: true,
sendMedia: true,
sendStickers: true,
sendGifs: true,
sendGames: true,
sendInline: true,
embedLinks: true
})
}) And this for small groups: await client.invoke(
new Api.messages.DeleteChatUser({
chatId: chatId,
userId: userId
})
) |
Beta Was this translation helpful? Give feedback.
-
Guys, I'm afraid I have to re-phrase my questions as TG is so confusing: const participants = client.iterParticipants("myGroup", {
limit: 10000,
}); and participants only gives me 750 users meanwhile in TG app, it shows I have around 2000 users. Question 2 - How to remove all "Deleted Account": if(participant.deleted){
console.log("username text is : ", participant.username);
} And it also gives mis-matched number... |
Beta Was this translation helpful? Give feedback.
-
I already figured out using iterParticipants to list all participants from a particular group. How to remove participants from a group? Which function can I call? Thanks~
Beta Was this translation helpful? Give feedback.
All reactions