tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Receiving message history from several chats at once #2827

Closed MorozovStVl closed 5 months ago

MorozovStVl commented 7 months ago

Good evening

I'm making a single feed that should contain messages from different chats (sorted by time). Is there a way to do this without making multiple GetChatHistory() requests to each chat? Tried to use SearchMessages(), but it returns an empty list if you don't specify a query string.

Help me please

levlam commented 7 months ago

There is no. You must call getChatHistory for all chats in question and merge the results manually.

MorozovStVl commented 6 months ago

Maybe the searchGlobal() function will help me? https://core.telegram.org/method/messages.searchGlobal

As far as I understand, this is a “pure” Telegram API and it is not in TdLib. Right?

levlam commented 6 months ago

Yes, and it will not help.