mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
renames for JVM signature duplication avoiding
This commit is contained in:
parent
7f4fe318c5
commit
f121e5f9c3
@ -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
|
||||
|
||||
|
@ -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 <T : BaseMessageUpdate> Flow<T>.filterByChatId(chatId: ChatId): Flow<T> = filter { it.data.chat.id == chatId }
|
||||
fun <T : BaseMessageUpdate> Flow<T>.filterBaseMessageUpdatesByChatId(chatId: ChatId): Flow<T> = filter { it.data.chat.id == chatId }
|
||||
/**
|
||||
* [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId] using [Chat.id] of [chat]
|
||||
*/
|
||||
fun <T : BaseMessageUpdate> Flow<T>.filterByChat(chat: Chat): Flow<T> = filterByChatId(chat.id)
|
||||
fun <T : BaseMessageUpdate> Flow<T>.filterBaseMessageUpdatesByChat(chat: Chat): Flow<T> = filterBaseMessageUpdatesByChatId(chat.id)
|
||||
/**
|
||||
* [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId]
|
||||
*/
|
||||
@Deprecated("Renamed", ReplaceWith("filterByChatId"))
|
||||
fun <T : BaseMessageUpdate> Flow<T>.filterBaseMessageUpdates(chatId: ChatId): Flow<T> = filterByChatId(chatId)
|
||||
@Deprecated("Renamed", ReplaceWith("filterBaseMessageUpdatesByChatId"))
|
||||
fun <T : BaseMessageUpdate> Flow<T>.filterBaseMessageUpdates(chatId: ChatId): Flow<T> = filterBaseMessageUpdatesByChatId(chatId)
|
||||
/**
|
||||
* [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId] using [Chat.id] of [chat]
|
||||
*/
|
||||
@Deprecated("Renamed", ReplaceWith("filterByChat"))
|
||||
fun <T : BaseMessageUpdate> Flow<T>.filterBaseMessageUpdates(chat: Chat): Flow<T> = filterByChatId(chat.id)
|
||||
@Deprecated("Renamed", ReplaceWith("filterBaseMessageUpdatesByChat"))
|
||||
fun <T : BaseMessageUpdate> Flow<T>.filterBaseMessageUpdates(chat: Chat): Flow<T> = filterBaseMessageUpdatesByChatId(chat.id)
|
||||
|
||||
|
||||
/**
|
||||
* [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId]
|
||||
*/
|
||||
fun <T : SentMediaGroupUpdate> Flow<T>.filterByChatId(chatId: ChatId): Flow<T> = filter { it.data.first().chat.id == chatId }
|
||||
fun <T : SentMediaGroupUpdate> Flow<T>.filterSentMediaGroupUpdatesByChatId(chatId: ChatId): Flow<T> = filter { it.data.first().chat.id == chatId }
|
||||
/**
|
||||
* [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId] using [Chat.id] of [chat]
|
||||
*/
|
||||
fun <T : SentMediaGroupUpdate> Flow<T>.filterByChat(chat: Chat): Flow<T> = filterByChatId(chat.id)
|
||||
fun <T : SentMediaGroupUpdate> Flow<T>.filterSentMediaGroupUpdatesByChat(chat: Chat): Flow<T> = filterSentMediaGroupUpdatesByChatId(chat.id)
|
||||
/**
|
||||
* [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId]
|
||||
*/
|
||||
@Deprecated("Renamed", ReplaceWith("filterByChatId"))
|
||||
fun <T : SentMediaGroupUpdate> Flow<T>.filterSentMediaGroupUpdates(chatId: ChatId): Flow<T> = filterByChatId(chatId)
|
||||
@Deprecated("Renamed", ReplaceWith("filterSentMediaGroupUpdatesByChatId"))
|
||||
fun <T : SentMediaGroupUpdate> Flow<T>.filterSentMediaGroupUpdates(chatId: ChatId): Flow<T> = filterSentMediaGroupUpdatesByChatId(chatId)
|
||||
/**
|
||||
* [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId] using [Chat.id] of [chat]
|
||||
*/
|
||||
@Deprecated("Renamed", ReplaceWith("filterByChat"))
|
||||
fun <T : SentMediaGroupUpdate> Flow<T>.filterSentMediaGroupUpdates(chat: Chat): Flow<T> = filterByChatId(chat.id)
|
||||
@Deprecated("Renamed", ReplaceWith("filterSentMediaGroupUpdatesByChat"))
|
||||
fun <T : SentMediaGroupUpdate> Flow<T>.filterSentMediaGroupUpdates(chat: Chat): Flow<T> = filterSentMediaGroupUpdatesByChatId(chat.id)
|
||||
|
Loading…
Reference in New Issue
Block a user