Telegram API does not return a complete list of chats and dialogs

I use TLSharp and the telegram API to work with the telegram. My problem is that when I try to get my list of dialogs using messages.getDialogs , it does not return a complete list of my active dialogs, gives channel identifiers, and also skips some other groups. in which I judge for reasons that I do not know.

for example, it returns about 20 chat identifiers when I have about 25 groups and 15 channels, but I never had a list of these chats. What is the method of getting a complete list of conversations, including their chat_id and title?

I want to get a complete list of my dialogs, including channels and groups, not user dialogs. I give this value offset = 0, max_id = 0, limit = 100in messages.getDialogs .

+4
source share
2 answers

The idea of ​​shifting and limiting is to give you a sliding window.

You can usually start with say, offset = 0 and limit = 20, and then send another request messages.Dialogswith an offset of 20, limit = 20.

Check each time, if the number of returned items each time is less than 20, you can stop the request.

This template should work.

+2
source
0

Source: https://habr.com/ru/post/1628462/


All Articles