gramjs icon indicating copy to clipboard operation
gramjs copied to clipboard

client.getParticipants duplicates participants

Open KishanBagaria opened this issue 1 year ago • 1 comments

const list = await this.client.getParticipants(dialogId, { limit: 256 })
console.log(members.total, members.length, members.map(m => m.id)) 
// members.total=3
// members.length=256
// members.map(m => m.id) = TotalList(256) [11,12,13,11,12,13,...]

Running [email protected]

Looks like including offset: 0 fixes it. Introduced by https://github.com/gram-js/gramjs/pull/386

KishanBagaria avatar Sep 06 '22 21:09 KishanBagaria

I don't think the offset necessarily fixes the issue entirely. I have a telegram group containing ~7k members - showed in the telegram app as well as in the total_count in the response, but get around 500 non-unique ids when iterating over the participants in batches (limit = 100) using the offset.

privorka avatar Sep 13 '22 16:09 privorka