All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.updates.InlineQueryUpdatesConversations.kt Maven / Gradle / Ivy

The newest version!
package com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.updates

import com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.internal_utils.onlySpecifiedTypeOfData
import com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.internal_utils.onlySpecifiedTypeOfDataWithUpdates
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.query.BaseInlineQuery
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.query.LocationInlineQuery
import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.update.InlineQueryUpdate
import kotlinx.coroutines.flow.*

/**
 * @return Mapped [Flow] with [Pair]s. [Pair.first] in this pair will be [UpdateIdentifier]. It could be useful in
 * cases you are using [InlineQueryUpdate.updateId] for some reasons. [Pair.second] will always be [BaseInlineQuery].
 */
fun Flow.onlyBaseInlineQueriesWithUpdates(): Flow> = onlySpecifiedTypeOfDataWithUpdates()

/**
 * @return Filter updates only with [BaseInlineQuery] and map it to a [Flow] with values [BaseInlineQuery]
 *
 * @see onlyBaseInlineQueriesWithUpdates
 */
fun Flow.onlyBaseInlineQueries(): Flow = onlySpecifiedTypeOfData()

/**
 * @return Mapped [Flow] with [Pair]s. [Pair.first] in this pair will be [UpdateIdentifier]. It could be useful in
 * cases you are using [InlineQueryUpdate.updateId] for some reasons. [Pair.second] will always be [LocationInlineQuery].
 */
fun Flow.onlyLocationInlineQueriesWithUpdates(): Flow> = onlySpecifiedTypeOfDataWithUpdates()

/**
 * @return Filter updates only with [LocationInlineQuery] and map it to a [Flow] with values [LocationInlineQuery]
 *
 * @see onlyLocationInlineQueriesWithUpdates
 */
fun Flow.onlyLocationInlineQueries(): Flow = onlySpecifiedTypeOfData()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy