Commit db87ad2
fix(groups): correct get_participants pagination
Two independent defects made every page beyond the first wrong:
1. TelegramClient.iter_participants takes no `offset` kwarg — its signature
is (entity, limit=None, *, search, filter, aggressive) — so passing
offset= raised TypeError for page > 1.
2. `limit` does not bound basic groups. _ParticipantsIter._init buffers the
whole participant list and returns True, and RequestIter.__anext__ then
sets `left` to the buffer length, discarding the requested limit. A page
of a basic group therefore ran past page_size.
Skip to the start of the requested page and stop once it is full. `limit`
is still passed so channels, where it is honoured, do not over-fetch.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 7ea0adc commit db87ad2
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | | - | |
| 246 | + | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
| 252 | + | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| |||
0 commit comments