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

commonMain.dev.inmo.tgbotapi.extensions.utils.ContentMessageConversations.kt Maven / Gradle / Ivy

There is a newer version: 20.0.1
Show newest version
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()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy