mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-22 16:47:13 +00:00
fix of content waiters and expecters
This commit is contained in:
parent
baf4c74b69
commit
61b720c61f
@ -5,6 +5,8 @@
|
||||
* `Common`:
|
||||
* `Version`:
|
||||
* `MicroUtils`: `0.4.28` -> `0.4.29`
|
||||
* `Behaviour Builder`:
|
||||
* Now content triggers and expectaters will wait for channel posts too
|
||||
|
||||
## 0.32.9
|
||||
|
||||
|
@ -31,7 +31,7 @@ private suspend fun <O> BehaviourContext.waitCommonMessage(
|
||||
(it as CommonMessage<MessageContent>).mapper()
|
||||
} ?.let { return@expectFlow it }
|
||||
}
|
||||
it.asMessageUpdate() ?.data ?.asCommonMessage() ?.mapper().let(::listOfNotNull)
|
||||
it.asBaseSentMessageUpdate() ?.data ?.asCommonMessage() ?.mapper().let(::listOfNotNull)
|
||||
}.toList().toList()
|
||||
|
||||
private suspend inline fun <reified T : MessageContent> BehaviourContext.waitContent(
|
||||
|
@ -36,7 +36,7 @@ internal suspend inline fun <reified T : MessageContent> BehaviourContext.onCont
|
||||
return@expectFlow it
|
||||
}
|
||||
}
|
||||
it.asMessageUpdate() ?.data ?.asCommonMessage() ?.let { message ->
|
||||
it.asBaseSentMessageUpdate() ?.data ?.asCommonMessage() ?.let { message ->
|
||||
if (message.content is T) {
|
||||
val adaptedMessage = message as CommonMessage<T>
|
||||
if (additionalFilter == null || additionalFilter(adaptedMessage)) adaptedMessage else null
|
||||
|
Loading…
Reference in New Issue
Block a user