From ff32fd1dfc298bc4d50d59f2146cb038ca501540 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 22 May 2020 12:56:50 +0600 Subject: [PATCH 1/5] 0.27.4 started --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eabd6a44c3..407c1b9a55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,8 @@ * `closePollExactAfter` * `closePollAfter` +### 0.27.4 + ### 0.27.3 * `TelegramBotAPI`: diff --git a/gradle.properties b/gradle.properties index 6a07572a4d..3c87806a9d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,6 +9,6 @@ ktor_version=1.3.2 javax_activation_version=1.1.1 library_group=com.github.insanusmokrassar -library_version=0.27.3 +library_version=0.27.4 gradle_bintray_plugin_version=1.8.4 From 105415873dca80cfa4a279c0aa6ccd7630487ba1 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 22 May 2020 13:21:22 +0600 Subject: [PATCH 2/5] updates extensions --- CHANGELOG.md | 9 ++++ TelegramBotAPI-extensions-utils/README.md | 26 ++++++++++ .../BaseMessagesUpdatesConversations.kt | 49 +++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/BaseMessagesUpdatesConversations.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 407c1b9a55..cf6154cc1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,15 @@ ### 0.27.4 +* `TelegramBotAPI-extensions-utils`: + * Several extensions for updates was added: + * `onlyBaseMessageUpdates` + * `onlySentMessageUpdates` + * `onlyEditMessageUpdates` + * `onlyMediaGroupsUpdates` + * `onlySentMediaGroupUpdates` + * `onlyEditMediaGroupUpdates` + ### 0.27.3 * `TelegramBotAPI`: diff --git a/TelegramBotAPI-extensions-utils/README.md b/TelegramBotAPI-extensions-utils/README.md index e2078e7f8b..b5b17083d1 100644 --- a/TelegramBotAPI-extensions-utils/README.md +++ b/TelegramBotAPI-extensions-utils/README.md @@ -166,6 +166,32 @@ application without creating of new one server (as it is happening in `startList There are several filters for flows. +#### Updates + +In the next table it is supposed that you are using some `Flow` with type from `Base type of update` and apply +extension `Extension` and will get `Flow` with type from `Result type of update` column. + +| Base type of update | Extension | Result type of update | +| ------------------- | --------- | --------------------- | +| `Update` | `onlyBaseMessageUpdates` | `BaseMessageUpdate` | +| | | | +| `BaseMessageUpdate` | `onlySentMessageUpdates` | `BaseSentMessageUpdate` | +| `BaseMessageUpdate` | `onlyEditMessageUpdates` | `BaseEditMessageUpdate` | +| `BaseMessageUpdate` | `onlyMediaGroupsUpdates` | `MediaGroupUpdate` | +| | | | +| `MediaGroupUpdate` | `onlySentMediaGroupUpdates` | `SentMediaGroupUpdate` | +| `MediaGroupUpdate` | `onlyEditMediaGroupUpdates` | `EditMediaGroupUpdate` | + +All of these extensions was made for more simple work with the others: + +```kotlin +val flow: Flow = ...; // here we are getting flow from somewhere, + // for example, FlowsUpdatesFilter#messageFlow +flow.onlySentMessageUpdates().filterExactCommands(Regex("start")) +``` + +Here we have used filter `filterExactCommands` which will pass only `ContentMessage` with only one command `start` + #### Sent messages All sent messages can be filtered for three types: diff --git a/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/BaseMessagesUpdatesConversations.kt b/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/BaseMessagesUpdatesConversations.kt new file mode 100644 index 0000000000..1280b4a397 --- /dev/null +++ b/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/BaseMessagesUpdatesConversations.kt @@ -0,0 +1,49 @@ +package com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.updates + +import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates.* +import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.* +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.mapNotNull + +fun Flow.onlyBaseMessageUpdates(): Flow = mapNotNull { + it as? BaseMessageUpdate +} + +/** + * Converts flow to [Flow] of [BaseSentMessageUpdate] + */ +fun Flow.onlySentMessageUpdates(): Flow = mapNotNull { + it as? BaseSentMessageUpdate +} + +/** + * Converts flow to [Flow] of [BaseSentMessageUpdate] + */ +fun Flow.onlyEditMessageUpdates(): Flow = mapNotNull { + it as? BaseEditMessageUpdate +} + +/** + * Converts flow to [Flow] of [MediaGroupUpdate]. Please, remember that it could be either [EditMediaGroupUpdate] + * or [SentMediaGroupUpdate] + * + * @see onlySentMediaGroupUpdates + * @see onlyEditMediaGroupUpdates + */ +fun Flow.onlyMediaGroupsUpdates(): Flow = mapNotNull { + it as? MediaGroupUpdate +} + +/** + * Converts flow to [Flow] of [SentMediaGroupUpdate] + */ +fun Flow.onlySentMediaGroupUpdates(): Flow = mapNotNull { + it as? SentMediaGroupUpdate +} + +/** + * Converts flow to [Flow] of [EditMediaGroupUpdate] + */ +fun Flow.onlyEditMediaGroupUpdates(): Flow = mapNotNull { + it as? EditMediaGroupUpdate +} From dbf5c2dbb281da481be1ed948b6f60d4e4876169 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 22 May 2020 14:03:48 +0600 Subject: [PATCH 3/5] update publish scripts --- TelegramBotAPI-all/maven.publish.gradle | 52 +++++++++---------- .../maven.publish.gradle | 52 +++++++++---------- .../maven.publish.gradle | 52 +++++++++---------- TelegramBotAPI/maven.publish.gradle | 52 +++++++++---------- 4 files changed, 96 insertions(+), 112 deletions(-) diff --git a/TelegramBotAPI-all/maven.publish.gradle b/TelegramBotAPI-all/maven.publish.gradle index b81cdc6f73..173e11888f 100644 --- a/TelegramBotAPI-all/maven.publish.gradle +++ b/TelegramBotAPI-all/maven.publish.gradle @@ -20,37 +20,33 @@ publishing { publications.all { artifact javadocsJar - pom.withXml { - asNode().children().last() + { - resolveStrategy = Closure.DELEGATE_FIRST + pom { + description = "This project just include all subproject of TelegramBotAPI" + name = "Telegram Bot API All" + url = "https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-all" - description "This project just include all subproject of TelegramBotAPI" - name "Telegram Bot API All" - url "https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-all" + scm { + developerConnection = "scm:git:[fetch=]https://github.com/insanusmokrassar/TelegramBotAPI.git[push=]https://github.com/insanusmokrassar/TelegramBotAPI.git" + url = "https://github.com/insanusmokrassar/TelegramBotAPI.git" + } - scm { - developerConnection "scm:git:[fetch=]https://github.com/insanusmokrassar/TelegramBotAPI.git[push=]https://github.com/insanusmokrassar/TelegramBotAPI.git" - url "https://github.com/insanusmokrassar/TelegramBotAPI.git" - } + developers { + + developer { + id = "InsanusMokrassar" + name = "Ovsiannikov Aleksei" + email = "ovsyannikov.alexey95@gmail.com" + } + + } - developers { - - developer { - id "InsanusMokrassar" - name "Ovsiannikov Aleksei" - email "ovsyannikov.alexey95@gmail.com" - } - - } - - licenses { - - license { - name "Apache Software License 2.0" - url "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE" - } - - } + licenses { + + license { + name = "Apache Software License 2.0" + url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE" + } + } } } diff --git a/TelegramBotAPI-extensions-api/maven.publish.gradle b/TelegramBotAPI-extensions-api/maven.publish.gradle index ec352c0e8c..799421de47 100644 --- a/TelegramBotAPI-extensions-api/maven.publish.gradle +++ b/TelegramBotAPI-extensions-api/maven.publish.gradle @@ -20,37 +20,33 @@ publishing { publications.all { artifact javadocsJar - pom.withXml { - asNode().children().last() + { - resolveStrategy = Closure.DELEGATE_FIRST + pom { + description = "API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference" + name = "Telegram Bot API Extensions for API" + url = "https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api" - description "API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference" - name "Telegram Bot API Extensions for API" - url "https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api" + scm { + developerConnection = "scm:git:[fetch=]https://github.com/insanusmokrassar/TelegramBotAPI.git[push=]https://github.com/insanusmokrassar/TelegramBotAPI.git" + url = "https://github.com/insanusmokrassar/TelegramBotAPI.git" + } - scm { - developerConnection "scm:git:[fetch=]https://github.com/insanusmokrassar/TelegramBotAPI.git[push=]https://github.com/insanusmokrassar/TelegramBotAPI.git" - url "https://github.com/insanusmokrassar/TelegramBotAPI.git" - } + developers { + + developer { + id = "InsanusMokrassar" + name = "Ovsiannikov Aleksei" + email = "ovsyannikov.alexey95@gmail.com" + } + + } - developers { - - developer { - id "InsanusMokrassar" - name "Ovsiannikov Aleksei" - email "ovsyannikov.alexey95@gmail.com" - } - - } - - licenses { - - license { - name "Apache Software License 2.0" - url "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE" - } - - } + licenses { + + license { + name = "Apache Software License 2.0" + url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE" + } + } } } diff --git a/TelegramBotAPI-extensions-utils/maven.publish.gradle b/TelegramBotAPI-extensions-utils/maven.publish.gradle index 61f4b51a17..c8600ea641 100644 --- a/TelegramBotAPI-extensions-utils/maven.publish.gradle +++ b/TelegramBotAPI-extensions-utils/maven.publish.gradle @@ -20,37 +20,33 @@ publishing { publications.all { artifact javadocsJar - pom.withXml { - asNode().children().last() + { - resolveStrategy = Closure.DELEGATE_FIRST + pom { + description = "Util extensions for more useful work with updates and other things" + name = "Telegram Bot API Utility Extensions" + url = "https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-utils" - description "Util extensions for more useful work with updates and other things" - name "Telegram Bot API Utility Extensions" - url "https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-utils" + scm { + developerConnection = "scm:git:[fetch=]https://github.com/insanusmokrassar/TelegramBotAPI.git[push=]https://github.com/insanusmokrassar/TelegramBotAPI.git" + url = "https://github.com/insanusmokrassar/TelegramBotAPI.git" + } - scm { - developerConnection "scm:git:[fetch=]https://github.com/insanusmokrassar/TelegramBotAPI.git[push=]https://github.com/insanusmokrassar/TelegramBotAPI.git" - url "https://github.com/insanusmokrassar/TelegramBotAPI.git" - } + developers { + + developer { + id = "InsanusMokrassar" + name = "Ovsiannikov Aleksei" + email = "ovsyannikov.alexey95@gmail.com" + } + + } - developers { - - developer { - id "InsanusMokrassar" - name "Ovsiannikov Aleksei" - email "ovsyannikov.alexey95@gmail.com" - } - - } - - licenses { - - license { - name "Apache Software License 2.0" - url "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE" - } - - } + licenses { + + license { + name = "Apache Software License 2.0" + url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE" + } + } } } diff --git a/TelegramBotAPI/maven.publish.gradle b/TelegramBotAPI/maven.publish.gradle index 4b5c24a389..9dc4d90cfa 100644 --- a/TelegramBotAPI/maven.publish.gradle +++ b/TelegramBotAPI/maven.publish.gradle @@ -20,37 +20,33 @@ publishing { publications.all { artifact javadocsJar - pom.withXml { - asNode().children().last() + { - resolveStrategy = Closure.DELEGATE_FIRST + pom { + description = "Library for Object-Oriented and type-safe work with Telegram Bot API" + name = "Telegram Bot API" + url = "https://insanusmokrassar.github.io/TelegramBotAPI" - description "Library for Object-Oriented and type-safe work with Telegram Bot API" - name "Telegram Bot API" - url "https://insanusmokrassar.github.io/TelegramBotAPI" + scm { + developerConnection = "scm:git:[fetch=]https://github.com/insanusmokrassar/TelegramBotAPI.git[push=]https://github.com/insanusmokrassar/TelegramBotAPI.git" + url = "https://github.com/insanusmokrassar/TelegramBotAPI.git" + } - scm { - developerConnection "scm:git:[fetch=]https://github.com/insanusmokrassar/TelegramBotAPI.git[push=]https://github.com/insanusmokrassar/TelegramBotAPI.git" - url "https://github.com/insanusmokrassar/TelegramBotAPI.git" - } + developers { + + developer { + id = "InsanusMokrassar" + name = "Ovsiannikov Aleksei" + email = "ovsyannikov.alexey95@gmail.com" + } + + } - developers { - - developer { - id "InsanusMokrassar" - name "Ovsiannikov Aleksei" - email "ovsyannikov.alexey95@gmail.com" - } - - } - - licenses { - - license { - name "Apache Software License 2.0" - url "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE" - } - - } + licenses { + + license { + name = "Apache Software License 2.0" + url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE" + } + } } } From 7f4fe318c59947bdbb3c3912240369e06c631d68 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 22 May 2020 16:40:30 +0600 Subject: [PATCH 4/5] update filters --- CHANGELOG.md | 3 ++ .../utils/updates/UpdatesChatFilters.kt | 33 ++++++++++++++----- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf6154cc1b..b710340ca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,9 @@ * `onlyMediaGroupsUpdates` * `onlySentMediaGroupUpdates` * `onlyEditMediaGroupUpdates` + * Renames in chat filters extensions: + * `filterBaseMessageUpdates` -> `filterByChatId` and `filterByChat` + * `filterSentMediaGroupUpdates` -> `filterByChatId` and `filterByChat` ### 0.27.3 diff --git a/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/UpdatesChatFilters.kt b/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/UpdatesChatFilters.kt index 4ee90dd8f9..2ad478455a 100644 --- a/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/UpdatesChatFilters.kt +++ b/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/UpdatesChatFilters.kt @@ -2,6 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.updates import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat +import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates.EditMediaGroupUpdate import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates.SentMediaGroupUpdate import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseMessageUpdate import kotlinx.coroutines.flow.Flow @@ -10,22 +11,38 @@ import kotlinx.coroutines.flow.filter /** * [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId] */ -fun Flow.filterBaseMessageUpdates(chatId: ChatId): Flow = filter { - it.data.chat.id == chatId -} +fun Flow.filterByChatId(chatId: ChatId): Flow = filter { it.data.chat.id == chatId } /** * [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId] using [Chat.id] of [chat] */ -fun Flow.filterBaseMessageUpdates(chat: Chat): Flow = filterBaseMessageUpdates(chat.id) +fun Flow.filterByChat(chat: Chat): Flow = filterByChatId(chat.id) +/** + * [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId] + */ +@Deprecated("Renamed", ReplaceWith("filterByChatId")) +fun Flow.filterBaseMessageUpdates(chatId: ChatId): Flow = filterByChatId(chatId) +/** + * [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId] using [Chat.id] of [chat] + */ +@Deprecated("Renamed", ReplaceWith("filterByChat")) +fun Flow.filterBaseMessageUpdates(chat: Chat): Flow = filterByChatId(chat.id) /** * [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId] */ -fun Flow.filterSentMediaGroupUpdates(chatId: ChatId): Flow = filter { - it.data.first().chat.id == chatId -} +fun Flow.filterByChatId(chatId: ChatId): Flow = filter { it.data.first().chat.id == chatId } /** * [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId] using [Chat.id] of [chat] */ -fun Flow.filterSentMediaGroupUpdates(chat: Chat): Flow = filterSentMediaGroupUpdates(chat.id) +fun Flow.filterByChat(chat: Chat): Flow = filterByChatId(chat.id) +/** + * [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId] + */ +@Deprecated("Renamed", ReplaceWith("filterByChatId")) +fun Flow.filterSentMediaGroupUpdates(chatId: ChatId): Flow = filterByChatId(chatId) +/** + * [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId] using [Chat.id] of [chat] + */ +@Deprecated("Renamed", ReplaceWith("filterByChat")) +fun Flow.filterSentMediaGroupUpdates(chat: Chat): Flow = filterByChatId(chat.id) From f121e5f9c327900a86d3dc33a0f81a5833177f6d Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 23 May 2020 12:53:42 +0600 Subject: [PATCH 5/5] renames for JVM signature duplication avoiding --- CHANGELOG.md | 4 +-- .../utils/updates/UpdatesChatFilters.kt | 25 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b710340ca6..3b064a4f38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,8 +60,8 @@ * `onlySentMediaGroupUpdates` * `onlyEditMediaGroupUpdates` * Renames in chat filters extensions: - * `filterBaseMessageUpdates` -> `filterByChatId` and `filterByChat` - * `filterSentMediaGroupUpdates` -> `filterByChatId` and `filterByChat` + * `filterBaseMessageUpdates` -> `filterBaseMessageUpdatesByChatId` and `filterBaseMessageUpdatesByChat` + * `filterSentMediaGroupUpdates` -> `filterSentMediaGroupUpdatesByChatId` and `filterSentMediaGroupUpdatesByChat` ### 0.27.3 diff --git a/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/UpdatesChatFilters.kt b/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/UpdatesChatFilters.kt index 2ad478455a..1812a94ec1 100644 --- a/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/UpdatesChatFilters.kt +++ b/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/updates/UpdatesChatFilters.kt @@ -2,7 +2,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.updates import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat -import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates.EditMediaGroupUpdate import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates.SentMediaGroupUpdate import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseMessageUpdate import kotlinx.coroutines.flow.Flow @@ -11,38 +10,38 @@ import kotlinx.coroutines.flow.filter /** * [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId] */ -fun Flow.filterByChatId(chatId: ChatId): Flow = filter { it.data.chat.id == chatId } +fun Flow.filterBaseMessageUpdatesByChatId(chatId: ChatId): Flow = filter { it.data.chat.id == chatId } /** * [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId] using [Chat.id] of [chat] */ -fun Flow.filterByChat(chat: Chat): Flow = filterByChatId(chat.id) +fun Flow.filterBaseMessageUpdatesByChat(chat: Chat): Flow = filterBaseMessageUpdatesByChatId(chat.id) /** * [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId] */ -@Deprecated("Renamed", ReplaceWith("filterByChatId")) -fun Flow.filterBaseMessageUpdates(chatId: ChatId): Flow = filterByChatId(chatId) +@Deprecated("Renamed", ReplaceWith("filterBaseMessageUpdatesByChatId")) +fun Flow.filterBaseMessageUpdates(chatId: ChatId): Flow = filterBaseMessageUpdatesByChatId(chatId) /** * [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId] using [Chat.id] of [chat] */ -@Deprecated("Renamed", ReplaceWith("filterByChat")) -fun Flow.filterBaseMessageUpdates(chat: Chat): Flow = filterByChatId(chat.id) +@Deprecated("Renamed", ReplaceWith("filterBaseMessageUpdatesByChat")) +fun Flow.filterBaseMessageUpdates(chat: Chat): Flow = filterBaseMessageUpdatesByChatId(chat.id) /** * [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId] */ -fun Flow.filterByChatId(chatId: ChatId): Flow = filter { it.data.first().chat.id == chatId } +fun Flow.filterSentMediaGroupUpdatesByChatId(chatId: ChatId): Flow = filter { it.data.first().chat.id == chatId } /** * [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId] using [Chat.id] of [chat] */ -fun Flow.filterByChat(chat: Chat): Flow = filterByChatId(chat.id) +fun Flow.filterSentMediaGroupUpdatesByChat(chat: Chat): Flow = filterSentMediaGroupUpdatesByChatId(chat.id) /** * [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId] */ -@Deprecated("Renamed", ReplaceWith("filterByChatId")) -fun Flow.filterSentMediaGroupUpdates(chatId: ChatId): Flow = filterByChatId(chatId) +@Deprecated("Renamed", ReplaceWith("filterSentMediaGroupUpdatesByChatId")) +fun Flow.filterSentMediaGroupUpdates(chatId: ChatId): Flow = filterSentMediaGroupUpdatesByChatId(chatId) /** * [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId] using [Chat.id] of [chat] */ -@Deprecated("Renamed", ReplaceWith("filterByChat")) -fun Flow.filterSentMediaGroupUpdates(chat: Chat): Flow = filterByChatId(chat.id) +@Deprecated("Renamed", ReplaceWith("filterSentMediaGroupUpdatesByChat")) +fun Flow.filterSentMediaGroupUpdates(chat: Chat): Flow = filterSentMediaGroupUpdatesByChatId(chat.id)