1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-01 07:25:23 +00:00
tgbotapi/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/CallbackQueryConversations.kt

13 lines
425 B
Kotlin
Raw Permalink Normal View History

package dev.inmo.tgbotapi.extensions.utils
2020-04-08 08:02:55 +00:00
import dev.inmo.tgbotapi.types.queries.callback.*
2020-04-08 08:02:55 +00:00
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.mapNotNull
fun <T : CallbackQuery> Flow<T>.onlyMessageDataCallbackQueries() = mapNotNull {
it as? MessageDataCallbackQuery
}
fun <T : CallbackQuery> Flow<T>.onlyInlineMessageIdDataCallbackQueries() = mapNotNull {
it as? InlineMessageIdDataCallbackQuery
}