TLSharp Get All Members In Group
Hi, i want to get all members in group but my code only attracts 10k members.
` public static async Task<ChannelInfo> GetChatInfo(string groupName) { if (! await AuthUser()) return null; var result = new ChannelInfo(); var dialogs = (TLDialogs)await client.GetUserDialogsAsync(); var main = dialogs.chats.lists.Where(c => c.GetType() == typeof(TLChannel)) .Cast<TLChannel>() .FirstOrDefault(c => c.title == (groupName)); var req = new TLRequestGetFullChannel() { channel = new TLInputChannel() { access_hash = main.access_hash.Value, channel_id = main.id } };
var res = await client.SendRequestAsync<TeleSharp.TL.Messages.TLChatFull>(req);
//we have to do this in slices
var offset = 0;
result.Channel = main;
result.ChatFull = res;
while (offset < (res.full_chat as TLChannelFull).participants_count)
{
var pReq = new TLRequestGetParticipants()
{
channel = new TLInputChannel() { access_hash = main.access_hash.Value, channel_id = main.id },
filter = new TLChannelParticipantsRecent() { },
limit = 200,
offset = offset
};
var pRes = await client.SendRequestAsync<TLChannelParticipants>(pReq);
result.Users.AddRange(pRes.users.lists.Cast<TLUser>());
offset += 200;
await Task.Delay(500);
}
return result;
}
`
see this: #926
where is the code i need to change?
search the method GetParticipants
If you have any concern about PR#926, comment on the PR, not here.