commonMain.com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.updates.CallbackQueryUpdatesConversations.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of TelegramBotAPI-extensions-utils-metadata Show documentation
Show all versions of TelegramBotAPI-extensions-utils-metadata Show documentation
Util extensions for more useful work with updates and other things
package com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.updates
import com.github.insanusmokrassar.TelegramBotAPI.types.CallbackQuery.*
import com.github.insanusmokrassar.TelegramBotAPI.types.update.CallbackQueryUpdate
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.mapNotNull
fun Flow.asDataCallbackQueryFlow() = mapNotNull {
it.data as? DataCallbackQuery
}
fun Flow.asGameShortNameCallbackQueryFlow() = mapNotNull {
it.data as? GameShortNameCallbackQuery
}
fun Flow.asUnknownCallbackQueryFlow() = mapNotNull {
it.data as? UnknownCallbackQueryType
}