commonMain.dev.inmo.tgbotapi.extensions.utils.ContentMessageConversations.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tgbotapi.utils Show documentation
Show all versions of tgbotapi.utils Show documentation
Additional extensions for core part of tgbotapi
package dev.inmo.tgbotapi.extensions.utils
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.*
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.mapNotNull
private inline fun Flow>.withContentType() = mapNotNull {
it.withContent()
}
fun Flow>.onlyAnimationContentMessages() = withContentType()
fun Flow>.onlyAudioContentMessages() = withContentType()
fun Flow>.onlyContactContentMessages() = withContentType()
fun Flow>.onlyDiceContentMessages() = withContentType()
fun Flow>.onlyDocumentContentMessages() = withContentType()
fun Flow>.onlyGameContentMessages() = withContentType()
fun Flow>.onlyInvoiceContentMessages() = withContentType()
fun Flow>.onlyLocationContentMessages() = withContentType()
fun Flow>.onlyPhotoContentMessages() = withContentType()
fun Flow>.onlyPollContentMessages() = withContentType()
fun Flow>.onlyStickerContentMessages() = withContentType()
fun Flow>.onlyTextContentMessages() = withContentType()
fun Flow>.onlyStoryContentMessages() = withContentType()
fun Flow>.onlyVenueContentMessages() = withContentType()
fun Flow>.onlyVideoContentMessages() = withContentType()
fun Flow>.onlyVideoNoteContentMessages() = withContentType()
fun Flow>.onlyVoiceContentMessages() = withContentType()