mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
a little bit refactor MediaGroupTriggers.kt
This commit is contained in:
parent
be710612b5
commit
bace2724da
@ -22,7 +22,11 @@ internal suspend inline fun <BC : BehaviourContext, reified T : MediaGroupConten
|
||||
markerFactory: MarkerFactory<in List<MediaGroupMessage<T>>, Any> = ByChatMediaGroupMarkerFactory,
|
||||
noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, List<MediaGroupMessage<T>>>
|
||||
) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) {
|
||||
(it.asSentMediaGroupUpdate() ?.data ?.takeIf { it.all { it.content is T } } as? List<MediaGroupMessage<T>>) ?.let(::listOfNotNull)
|
||||
(it.asSentMediaGroupUpdate() ?.data ?.takeIf { messages ->
|
||||
messages.all { message ->
|
||||
message.content is T
|
||||
}
|
||||
} as? List<MediaGroupMessage<T>>) ?.let(::listOfNotNull)
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user