24-02-21, 05:57 PM
Dim gruopName As String = "PornHub"
Dim client = NewClient()
Await client.ConnectAsync()
Dim dialogs = CType(Await, TLDialogs) client.GetUserDialogsAsync()
Dim main = dialogs.Chats.ToList().Where(Function© c.GetType() Is GetType(TLChannel)).Cast(Of TLChannel)().FirstOrDefault(Function© c.Title = (gruopName))
Dim req = New TLRequestGetFullChannel() With { _
.Channel = New TLInputChannel() With { _
.AccessHash =CLng(Fix(main.AccessHash)), _
.ChannelId = main.Id _
} _
}
Dim res = Await client.SendRequestAsync(Of TeleSharp.TL.Messages.TLChatFull)(req)
Dim result = New ChannelInfo()
Dim offset = 0
Do While offset < (TryCast(res.FullChat, TLChannelFull)).ParticipantsCount
Dim pReq = New TLRequestGetParticipants() With { _
.Channel = New TLInputChannel() With { _
.AccessHash = main.AccessHash.Value, _
.ChannelId = main.Id _
}, _
.Filter = New TLChannelParticipantsRecent (New() { }), _
.Limit = 200, _
.Offset = offset _
}
Dim pRes = Await client.SendRequestAsync(Of TLChannelParticipants)(pReq)
result.Users.AddRange(pRes.Users.ToList().Cast(Of TLUser)())
offset += 200
Await Task.Delay(500)
Loop
Dim client = NewClient()
Await client.ConnectAsync()
Dim dialogs = CType(Await, TLDialogs) client.GetUserDialogsAsync()
Dim main = dialogs.Chats.ToList().Where(Function© c.GetType() Is GetType(TLChannel)).Cast(Of TLChannel)().FirstOrDefault(Function© c.Title = (gruopName))
Dim req = New TLRequestGetFullChannel() With { _
.Channel = New TLInputChannel() With { _
.AccessHash =CLng(Fix(main.AccessHash)), _
.ChannelId = main.Id _
} _
}
Dim res = Await client.SendRequestAsync(Of TeleSharp.TL.Messages.TLChatFull)(req)
Dim result = New ChannelInfo()
Dim offset = 0
Do While offset < (TryCast(res.FullChat, TLChannelFull)).ParticipantsCount
Dim pReq = New TLRequestGetParticipants() With { _
.Channel = New TLInputChannel() With { _
.AccessHash = main.AccessHash.Value, _
.ChannelId = main.Id _
}, _
.Filter = New TLChannelParticipantsRecent (New() { }), _
.Limit = 200, _
.Offset = offset _
}
Dim pRes = Await client.SendRequestAsync(Of TLChannelParticipants)(pReq)
result.Users.AddRange(pRes.Users.ToList().Cast(Of TLUser)())
offset += 200
Await Task.Delay(500)
Loop

