1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00

rewrite handleUpdates

This commit is contained in:
InsanusMokrassar 2019-03-23 15:19:29 +08:00
parent 7d1871d8dc
commit ac5d3214b4

View File

@ -56,9 +56,13 @@ class UpdatesPoller(
} }
private suspend fun handleUpdates(updates: List<Update>) { private suspend fun handleUpdates(updates: List<Update>) {
updates.forEach { update -> for (update in updates) {
(update as? BaseMessageUpdate) ?.let { (update as? BaseMessageUpdate) ?.let {
pushMediaGroupUpdate(it) if (it.data is MediaGroupMessage) {
pushMediaGroupUpdate(it)
} else {
null
}
} ?:let { } ?:let {
pushMediaGroupUpdate() pushMediaGroupUpdate()
sendToBlock(update) sendToBlock(update)