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)