mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
update FlowsUpdatesFilter
This commit is contained in:
parent
d7bca15693
commit
20b931138c
@ -6,8 +6,7 @@ import dev.inmo.tgbotapi.extensions.utils.updates.asContentMessagesFlow
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.content.*
|
import dev.inmo.tgbotapi.types.message.content.*
|
||||||
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaGroupContent
|
import dev.inmo.tgbotapi.types.message.content.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.media.*
|
import dev.inmo.tgbotapi.types.message.content.media.*
|
||||||
import dev.inmo.tgbotapi.types.message.payments.InvoiceContent
|
import dev.inmo.tgbotapi.types.message.payments.InvoiceContent
|
||||||
import dev.inmo.tgbotapi.types.update.MediaGroupUpdates.SentMediaGroupUpdate
|
import dev.inmo.tgbotapi.types.update.MediaGroupUpdates.SentMediaGroupUpdate
|
||||||
@ -101,6 +100,12 @@ fun Flow<BaseSentMessageUpdate>.audioMessages() = filterContentMessages<AudioCon
|
|||||||
fun FlowsUpdatesFilter.audioMessages(
|
fun FlowsUpdatesFilter.audioMessages(
|
||||||
scopeToIncludeChannels: CoroutineScope? = null
|
scopeToIncludeChannels: CoroutineScope? = null
|
||||||
) = filterContentMessages<AudioContent>(scopeToIncludeChannels)
|
) = filterContentMessages<AudioContent>(scopeToIncludeChannels)
|
||||||
|
fun FlowsUpdatesFilter.audioMessagesWithMediaGroups(
|
||||||
|
scopeToIncludeChannels: CoroutineScope? = null
|
||||||
|
) = merge(
|
||||||
|
filterContentMessages<AudioContent>(scopeToIncludeChannels),
|
||||||
|
mediaGroupAudioMessages(scopeToIncludeChannels).flatMap()
|
||||||
|
)
|
||||||
|
|
||||||
fun Flow<BaseSentMessageUpdate>.contactMessages() = filterContentMessages<ContactContent>()
|
fun Flow<BaseSentMessageUpdate>.contactMessages() = filterContentMessages<ContactContent>()
|
||||||
fun FlowsUpdatesFilter.contactMessages(
|
fun FlowsUpdatesFilter.contactMessages(
|
||||||
@ -116,6 +121,12 @@ fun Flow<BaseSentMessageUpdate>.documentMessages() = filterContentMessages<Docum
|
|||||||
fun FlowsUpdatesFilter.documentMessages(
|
fun FlowsUpdatesFilter.documentMessages(
|
||||||
scopeToIncludeChannels: CoroutineScope? = null
|
scopeToIncludeChannels: CoroutineScope? = null
|
||||||
) = filterContentMessages<DocumentContent>(scopeToIncludeChannels)
|
) = filterContentMessages<DocumentContent>(scopeToIncludeChannels)
|
||||||
|
fun FlowsUpdatesFilter.documentMessagesWithMediaGroups(
|
||||||
|
scopeToIncludeChannels: CoroutineScope? = null
|
||||||
|
) = merge(
|
||||||
|
filterContentMessages<DocumentContent>(scopeToIncludeChannels),
|
||||||
|
mediaGroupDocumentMessages(scopeToIncludeChannels).flatMap()
|
||||||
|
)
|
||||||
|
|
||||||
fun Flow<BaseSentMessageUpdate>.gameMessages() = filterContentMessages<GameContent>()
|
fun Flow<BaseSentMessageUpdate>.gameMessages() = filterContentMessages<GameContent>()
|
||||||
fun FlowsUpdatesFilter.gameMessages(
|
fun FlowsUpdatesFilter.gameMessages(
|
||||||
@ -210,3 +221,18 @@ fun Flow<SentMediaGroupUpdate>.mediaGroupVideosMessages() = filterMediaGroupMess
|
|||||||
fun FlowsUpdatesFilter.mediaGroupVideosMessages(
|
fun FlowsUpdatesFilter.mediaGroupVideosMessages(
|
||||||
scopeToIncludeChannels: CoroutineScope? = null
|
scopeToIncludeChannels: CoroutineScope? = null
|
||||||
) = filterMediaGroupMessages<VideoContent>(scopeToIncludeChannels)
|
) = filterMediaGroupMessages<VideoContent>(scopeToIncludeChannels)
|
||||||
|
|
||||||
|
fun Flow<SentMediaGroupUpdate>.mediaGroupVisualMessages() = filterMediaGroupMessages<VisualMediaGroupContent>()
|
||||||
|
fun FlowsUpdatesFilter.mediaGroupVisualMessages(
|
||||||
|
scopeToIncludeChannels: CoroutineScope? = null
|
||||||
|
) = filterMediaGroupMessages<VisualMediaGroupContent>(scopeToIncludeChannels)
|
||||||
|
|
||||||
|
fun Flow<SentMediaGroupUpdate>.mediaGroupAudioMessages() = filterMediaGroupMessages<AudioContent>()
|
||||||
|
fun FlowsUpdatesFilter.mediaGroupAudioMessages(
|
||||||
|
scopeToIncludeChannels: CoroutineScope? = null
|
||||||
|
) = filterMediaGroupMessages<AudioContent>(scopeToIncludeChannels)
|
||||||
|
|
||||||
|
fun Flow<SentMediaGroupUpdate>.mediaGroupDocumentMessages() = filterMediaGroupMessages<DocumentContent>()
|
||||||
|
fun FlowsUpdatesFilter.mediaGroupDocumentMessages(
|
||||||
|
scopeToIncludeChannels: CoroutineScope? = null
|
||||||
|
) = filterMediaGroupMessages<DocumentContent>(scopeToIncludeChannels)
|
||||||
|
Loading…
Reference in New Issue
Block a user