startListenChats

fun startListenChats(includeOutgoing: Boolean = true, chats: List<Long>): Flow<NewMessage>

Starts listening to messages from specified chats. Returns a Flow of NewMessage objects that can be collected to receive new messages.

Return

Flow of NewMessage objects

Parameters

includeOutgoing

Whether to include outgoing messages in the flow

chats

List of chat IDs to listen to

Throws

TelegramException.Error

if the client is not initialized (setup() was not called)