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