0

我试图从一个拥有超过 2k 用户的频道中获取完整的用户列表,但我总是能得到 200 个用户。但是,它可以提取具有 +10k 用户的超级组的所有成员,但不适用于频道。这里有一个例子来说明:

var req = new TLRequestGetFullChannel()
{
    Channel = new TLInputChannel() { AccessHash = currentTLChannel.AccessHash.Value, ChannelId = currentTLChannel.Id }
};
var res = await BotClient.SendRequestAsync<TeleSharp.TL.Messages.TLChatFull>(req);
var offset = 0;
result.Channel = currentTLChannel;
result.ChatFull = res;
while (offset < (res.FullChat as TLChannelFull).ParticipantsCount)
{
    var pReq = new TLRequestGetParticipants()
    {
        Channel = new TLInputChannel() { AccessHash = currentTLChannel.AccessHash.Value, ChannelId = currentTLChannel.Id },
        Filter = new TLChannelParticipantsRecent() { },
        Limit = 200,
        Offset = offset
    };
    await Task.Delay(500);
    var pRes = await BotClient.SendRequestAsync<TLChannelParticipants>(pReq);
    result.Users.AddRange(pRes.Users.ToList().Cast<TLUser>());
    offset += 200;
    await Task.Delay(500);
}

如何更改我的代码,以便它可以获取所有具有 +2k 成员的频道成员?

4

0 回答 0