diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ae378e21b..15bd48bffe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,14 @@ ## 7.0.0 +This update contains support of [Telegram Bot API 6.6](https://core.telegram.org/bots/api-changelog#march-9-2023) + **THIS VERSION CONTAINS BREAKING CHANGES**: +* All previous deprecations have been removed * Fully reworked mechanism of stickers creating and adding + * All separations of stickers types like `Animeted` have been replaces with type `StickerFormat` + * New `InputSticker` type (and all subtypes) as replacements for old raw fields in methods ## 6.1.0 diff --git a/README.md b/README.md index cff3e58404..4050520095 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-6.5-blue)](https://core.telegram.org/bots/api-changelog#february-3-2023) +# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-6.6-blue)](https://core.telegram.org/bots/api-changelog#march-9-2023) | Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Bookstack&message=Tutorial&color=blue&logo=bookstack)](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) | |:---:|:---:| diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStickerSet.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStickerSet.kt index 6b73341d94..c4213bf3df 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStickerSet.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/get/GetStickerSet.kt @@ -10,13 +10,6 @@ suspend fun TelegramBot.getStickerSet( GetStickerSet(name) ) -@Deprecated("Renamed", ReplaceWith("getStickerSetOrThrow(sticker)", "dev.inmo.tgbotapi.extensions.api.get.getStickerSetOrThrow")) -suspend fun TelegramBot.getStickerSet( - sticker: Sticker -) = getStickerSet( - sticker.stickerSetName ?: error("Sticker must contains stickerSetName to be correctly used in getStickerSet method") -) - suspend fun TelegramBot.getStickerSetOrNull( sticker: Sticker ) = sticker.stickerSetName ?.let { diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt index c5e706be4b..007ff4d2cd 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt @@ -20,15 +20,6 @@ suspend inline fun BehaviourContext.waitContent( ): Flow = waitContentMessage(initRequest, errorFactory).map { it.content } -@Deprecated( - includeMediaGroupsDeprecationMessage, - ReplaceWith("waitAnyContent(initRequest, errorFactory)", "dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitAnyContent") -) -suspend fun BehaviourContext.waitContent( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContent(initRequest, errorFactory) suspend fun BehaviourContext.waitAnyContent( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } @@ -69,62 +60,26 @@ suspend fun BehaviourContext.waitVenue( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContent(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitAudioMediaGroupContent( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContent(initRequest, errorFactory) suspend fun BehaviourContext.waitAudioMediaGroupContent( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null }, ) = waitContent(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitDocumentMediaGroupContent( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContent(initRequest, errorFactory) suspend fun BehaviourContext.waitDocumentMediaGroupContent( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContent(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitMedia( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContent(initRequest, errorFactory) suspend fun BehaviourContext.waitMedia( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContent(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitAnyMediaGroupContent( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContent(initRequest, errorFactory) suspend fun BehaviourContext.waitAnyMediaGroupContent( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null }, ) = waitContent(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitVisualMediaGroupContent( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContent(initRequest, errorFactory) suspend fun BehaviourContext.waitVisualMediaGroupContent( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null }, ) = waitContent(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitTextedMediaContent( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContent(initRequest, errorFactory) suspend fun BehaviourContext.waitTextedMediaContent( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null }, @@ -133,32 +88,14 @@ suspend fun BehaviourContext.waitAnimation( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContent(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitAudio( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContent(initRequest, errorFactory) suspend fun BehaviourContext.waitAudio( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null }, ) = waitContent(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitDocument( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContent(initRequest, errorFactory) suspend fun BehaviourContext.waitDocument( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null }, ) = waitContent(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitPhoto( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContent(initRequest, errorFactory) suspend fun BehaviourContext.waitPhoto( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null }, @@ -167,12 +104,6 @@ suspend fun BehaviourContext.waitSticker( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContent(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitVideo( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContent(initRequest, errorFactory) suspend fun BehaviourContext.waitVideo( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentMessage.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentMessage.kt index 08ccca9aa5..e79ae00a13 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentMessage.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentMessage.kt @@ -13,7 +13,6 @@ import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -const val includeMediaGroupsDeprecationMessage = "includeMediaGroups is deprecated and its usage will not lead to any changes" typealias CommonMessageToCommonMessageMapper = suspend CommonMessage.() -> CommonMessage? @RiskFeature(lowLevelRiskFeatureMessage) @@ -47,15 +46,6 @@ internal inline fun contentMessageConverter( if (content is T) this as CommonMessage else null } -@Deprecated( - includeMediaGroupsDeprecationMessage, - ReplaceWith("waitAnyContentMessage(initRequest, errorFactory)", "dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitAnyContentMessage") -) -suspend fun BehaviourContext.waitContentMessage( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContentMessage(initRequest, errorFactory) suspend fun BehaviourContext.waitAnyContentMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null }, @@ -96,62 +86,26 @@ suspend fun BehaviourContext.waitVenueMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContentMessage(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitAudioMediaGroupContentMessage( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContentMessage(initRequest, errorFactory) suspend fun BehaviourContext.waitAudioMediaGroupContentMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContentMessage(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitDocumentMediaGroupContentMessage( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContentMessage(initRequest, errorFactory) suspend fun BehaviourContext.waitDocumentMediaGroupContentMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContentMessage(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitMediaMessage( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContentMessage(initRequest, errorFactory) suspend fun BehaviourContext.waitMediaMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContentMessage(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitAnyMediaGroupContentMessage( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContentMessage(initRequest, errorFactory) suspend fun BehaviourContext.waitAnyMediaGroupContentMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContentMessage(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitVisualMediaGroupContentMessage( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContentMessage(initRequest, errorFactory) suspend fun BehaviourContext.waitVisualMediaGroupContentMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContentMessage(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitTextedMediaContentMessage( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContentMessage(initRequest, errorFactory) suspend fun BehaviourContext.waitTextedMediaContentMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } @@ -160,32 +114,14 @@ suspend fun BehaviourContext.waitAnimationMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContentMessage(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitAudioMessage( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContentMessage(initRequest, errorFactory) suspend fun BehaviourContext.waitAudioMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContentMessage(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitDocumentMessage( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContentMessage(initRequest, errorFactory) suspend fun BehaviourContext.waitDocumentMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContentMessage(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitPhotoMessage( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContentMessage(initRequest, errorFactory) suspend fun BehaviourContext.waitPhotoMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } @@ -194,12 +130,6 @@ suspend fun BehaviourContext.waitStickerMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContentMessage(initRequest, errorFactory) -@Deprecated(includeMediaGroupsDeprecationMessage) -suspend fun BehaviourContext.waitVideoMessage( - initRequest: Request<*>? = null, - errorFactory: NullableRequestBuilder<*> = { null }, - includeMediaGroups: Boolean -) = waitContentMessage(initRequest, errorFactory) suspend fun BehaviourContext.waitVideoMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt index 2fb21d12f3..1f736a6adf 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt @@ -109,7 +109,7 @@ suspend fun BehaviourContext.waitGroupChatCreatedEvents( suspend fun BehaviourContext.waitLeftChatMemberEvents( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } -) = waitEvents(initRequest, errorFactory) +) = waitEvents(initRequest, errorFactory) suspend fun BehaviourContext.waitNewChatPhotoEvents( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionMessages.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionMessages.kt index 9539f3d2fd..a271ee8b9d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionMessages.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionMessages.kt @@ -106,7 +106,7 @@ suspend fun BehaviourContext.waitGroupChatCreatedEventsMessages( suspend fun BehaviourContext.waitLeftChatMemberEventsMessages( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } -) = waitEventsMessages(initRequest, errorFactory) +) = waitEventsMessages(initRequest, errorFactory) suspend fun BehaviourContext.waitNewChatPhotoEventsMessages( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt index 645ac7effb..11e6708abf 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt @@ -346,10 +346,10 @@ suspend fun BC.onGroupChatCreated( * data */ suspend fun BC.onLeftChatMember( - initialFilter: SimpleFilter>? = null, - subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: CustomBehaviourContextAndTypeReceiver> + initialFilter: SimpleFilter>? = null, + subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, + markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) /** diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/Sticker.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/Sticker.kt index 48932491ab..248e1a2e98 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/Sticker.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/Sticker.kt @@ -213,8 +213,7 @@ data class RegularSimpleSticker( @SerialName(fileSizeField) override val fileSize: Long? = null, ) : RegularSticker -@Deprecated("Renamed", ReplaceWith("SimpleRegularSticker", "dev.inmo.tgbotapi.types.files.SimpleRegularSticker")) -typealias SimpleSticker = RegularSimpleSticker + @Serializable data class RegularAnimatedSticker( @SerialName(fileIdField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMember.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMember.kt index 4d664fcbd0..f1104ab037 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMember.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMember.kt @@ -7,6 +7,3 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PublicChatEvent data class LeftChatMemberEvent( override val user: User ) : PublicChatEvent, WithUser - -@Deprecated("Renamed", ReplaceWith("dev.inmo.tgbotapi.types.message.ChatEvents", "LeftChatMemberEvent")) -typealias LeftChatMember = LeftChatMemberEvent diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt index 16eb920f55..58eb633bd6 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt @@ -57,18 +57,3 @@ sealed interface ForwardInfo { } } } - -@Deprecated("Replaced", ReplaceWith("ForwardInfo.ByAnonymous", "dev.inmo.tgbotapi.types.message.ForwardInfo")) -typealias AnonymousForwardInfo = ForwardInfo.ByAnonymous - -@Deprecated("Replaced", ReplaceWith("ForwardInfo.ByUser", "dev.inmo.tgbotapi.types.message.ForwardInfo")) -typealias UserForwardInfo = ForwardInfo.ByUser - -@Deprecated("Replaced", ReplaceWith("ForwardInfo.PublicChat", "dev.inmo.tgbotapi.types.message.ForwardInfo")) -typealias ForwardFromPublicChatInfo = ForwardInfo.PublicChat - -@Deprecated("Replaced", ReplaceWith("ForwardInfo.PublicChat.FromChannel", "dev.inmo.tgbotapi.types.message.ForwardInfo")) -typealias ForwardFromChannelInfo = ForwardInfo.PublicChat.FromChannel - -@Deprecated("Replaced", ReplaceWith("ForwardInfo.PublicChat.FromSupergroup", "dev.inmo.tgbotapi.types.message.ForwardInfo")) -typealias ForwardFromSupergroupInfo = ForwardInfo.PublicChat.FromSupergroup diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt index 684b74757f..eb43475213 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt @@ -223,7 +223,7 @@ internal data class RawMessage( private val chatEvent: ChatEvent? by lazy { when { new_chat_members != null -> NewChatMembers(new_chat_members.toList()) - left_chat_member != null -> LeftChatMember(left_chat_member) + left_chat_member != null -> LeftChatMemberEvent(left_chat_member) new_chat_title != null -> NewChatTitle(new_chat_title) new_chat_photo != null -> NewChatPhoto(new_chat_photo.toList()) video_chat_started != null -> video_chat_started @@ -242,12 +242,15 @@ internal data class RawMessage( group_chat_created -> GroupChatCreated( migrate_to_chat_id ) + supergroup_chat_created -> SupergroupChatCreated( migrate_from_chat_id ) + migrate_from_chat_id != null -> MigratedToSupergroup( migrate_from_chat_id ) + channel_chat_created -> ChannelChatCreated() pinned_message != null -> PinnedMessage(pinned_message.asMessage) proximity_alert_triggered != null -> proximity_alert_triggered diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt index e86e5215a2..354d84947a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt @@ -34,9 +34,6 @@ sealed interface StickerSet { @Deprecated("Renamed in telegram bot api") val thumb: PhotoSize? get() = thumbnail - @Deprecated("Will be removed soon due to its redundancy") - val containsMasks: Boolean - get() = this is MaskStickerSet object Serializer : KSerializer { override val descriptor: SerialDescriptor = JsonElement.serializer().descriptor diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt index 2e9c700266..b1e7c195bf 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt @@ -14,9 +14,6 @@ interface FlowsUpdatesFilter : UpdatesFilter { override val allowedUpdates: List get() = ALL_UPDATES_LIST val allUpdatesFlow: Flow - @Deprecated("Since 4.0.0 is not actual", ReplaceWith("allUpdatesFlow")) - val allUpdatesWithoutMediaGroupsGroupingFlow: Flow - get() = allUpdatesFlow val messagesFlow: Flow val messageMediaGroupsFlow: Flow diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt index 27b1e6f8fa..ccb25f7023 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt @@ -30,7 +30,6 @@ import dev.inmo.tgbotapi.types.location.* import dev.inmo.tgbotapi.types.media.* import dev.inmo.tgbotapi.types.message.* import dev.inmo.tgbotapi.types.message.ChatEvents.* -import dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMember import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* import dev.inmo.tgbotapi.types.message.abstracts.* @@ -1943,13 +1942,13 @@ inline fun ChatMember.asKickedChatMember(): KickedChatMember? = this as? KickedC inline fun ChatMember.requireKickedChatMember(): KickedChatMember = this as KickedChatMember @PreviewFeature -inline fun ChatMember.whenLeftChatMember(block: (LeftChatMember) -> T) = asLeftChatMember()?.let(block) +inline fun ChatMember.whenLeftChatMember(block: (LeftChatMemberEvent) -> T) = asLeftChatMember()?.let(block) @PreviewFeature -inline fun ChatMember.asLeftChatMember(): LeftChatMember? = this as? LeftChatMember +inline fun ChatMember.asLeftChatMember(): LeftChatMemberEvent? = this as? LeftChatMemberEvent @PreviewFeature -inline fun ChatMember.requireLeftChatMember(): LeftChatMember = this as LeftChatMember +inline fun ChatMember.requireLeftChatMember(): LeftChatMemberEvent = this as LeftChatMemberEvent @PreviewFeature inline fun ChatMember.whenMemberChatMember(block: (MemberChatMember) -> T) = asMemberChatMember()?.let(block) @@ -2382,15 +2381,6 @@ inline fun TelegramMediaFile.asSticker(): Sticker? = this as? Sticker @PreviewFeature inline fun TelegramMediaFile.requireSticker(): Sticker = this as Sticker -@PreviewFeature -inline fun TelegramMediaFile.whenSimpleSticker(block: (SimpleSticker) -> T) = asSimpleSticker()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.asSimpleSticker(): SimpleSticker? = this as? SimpleSticker - -@PreviewFeature -inline fun TelegramMediaFile.requireSimpleSticker(): SimpleSticker = this as SimpleSticker - @PreviewFeature inline fun TelegramMediaFile.whenAnimatedSticker(block: (AnimatedSticker) -> T) = asAnimatedSticker()?.let(block) @@ -2741,10 +2731,12 @@ inline fun ResendableContent.whenAudioMediaGroupContent(block: (AudioMediaGr asAudioMediaGroupContent()?.let(block) @PreviewFeature -inline fun ResendableContent.asAudioMediaGroupContent(): AudioMediaGroupPartContent? = this as? AudioMediaGroupPartContent +inline fun ResendableContent.asAudioMediaGroupContent(): AudioMediaGroupPartContent? = + this as? AudioMediaGroupPartContent @PreviewFeature -inline fun ResendableContent.requireAudioMediaGroupContent(): AudioMediaGroupPartContent = this as AudioMediaGroupPartContent +inline fun ResendableContent.requireAudioMediaGroupContent(): AudioMediaGroupPartContent = + this as AudioMediaGroupPartContent @PreviewFeature inline fun ResendableContent.whenDocumentMediaGroupContent(block: (DocumentMediaGroupPartContent) -> T) = @@ -2815,10 +2807,12 @@ inline fun ResendableContent.whenVisualMediaGroupContent(block: (VisualMedia asVisualMediaGroupContent()?.let(block) @PreviewFeature -inline fun ResendableContent.asVisualMediaGroupContent(): VisualMediaGroupPartContent? = this as? VisualMediaGroupPartContent +inline fun ResendableContent.asVisualMediaGroupContent(): VisualMediaGroupPartContent? = + this as? VisualMediaGroupPartContent @PreviewFeature -inline fun ResendableContent.requireVisualMediaGroupContent(): VisualMediaGroupPartContent = this as VisualMediaGroupPartContent +inline fun ResendableContent.requireVisualMediaGroupContent(): VisualMediaGroupPartContent = + this as VisualMediaGroupPartContent @PreviewFeature inline fun ResendableContent.whenAnimationContent(block: (AnimationContent) -> T) = asAnimationContent()?.let(block) @@ -3165,13 +3159,13 @@ inline fun ChatEvent.asGroupChatCreated(): GroupChatCreated? = this as? GroupCha inline fun ChatEvent.requireGroupChatCreated(): GroupChatCreated = this as GroupChatCreated @PreviewFeature -inline fun ChatEvent.whenLeftChatMember(block: (LeftChatMember) -> T) = asLeftChatMember()?.let(block) +inline fun ChatEvent.whenLeftChatMember(block: (LeftChatMemberEvent) -> T) = asLeftChatMember()?.let(block) @PreviewFeature -inline fun ChatEvent.asLeftChatMember(): LeftChatMember? = this as? LeftChatMember +inline fun ChatEvent.asLeftChatMember(): LeftChatMemberEvent? = this as? LeftChatMemberEvent @PreviewFeature -inline fun ChatEvent.requireLeftChatMember(): LeftChatMember = this as LeftChatMember +inline fun ChatEvent.requireLeftChatMember(): LeftChatMemberEvent = this as LeftChatMemberEvent @PreviewFeature inline fun ChatEvent.whenMessageAutoDeleteTimerChanged(block: (MessageAutoDeleteTimerChanged) -> T) = @@ -3522,26 +3516,6 @@ inline fun ForwardInfo.asForwardFromPublicChatInfo(): ForwardInfo.PublicChat? = @PreviewFeature inline fun ForwardInfo.requireForwardFromPublicChatInfo(): ForwardInfo.PublicChat = this as ForwardInfo.PublicChat -@PreviewFeature -inline fun ForwardInfo.whenForwardFromChannelInfo(block: (ForwardFromChannelInfo) -> T) = - asForwardFromChannelInfo()?.let(block) - -@PreviewFeature -inline fun ForwardInfo.asForwardFromChannelInfo(): ForwardFromChannelInfo? = this as? ForwardFromChannelInfo - -@PreviewFeature -inline fun ForwardInfo.requireForwardFromChannelInfo(): ForwardFromChannelInfo = this as ForwardFromChannelInfo - -@PreviewFeature -inline fun ForwardInfo.whenForwardFromSupergroupInfo(block: (ForwardFromSupergroupInfo) -> T) = - asForwardFromSupergroupInfo()?.let(block) - -@PreviewFeature -inline fun ForwardInfo.asForwardFromSupergroupInfo(): ForwardFromSupergroupInfo? = this as? ForwardFromSupergroupInfo - -@PreviewFeature -inline fun ForwardInfo.requireForwardFromSupergroupInfo(): ForwardFromSupergroupInfo = this as ForwardFromSupergroupInfo - @PreviewFeature inline fun MessageContent.whenTextedInput(block: (TextedInput) -> T) = asTextedInput()?.let(block) diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt index 2964fe0f57..ca069ef5c4 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt @@ -35,10 +35,10 @@ inline val Message.forward_from_chat: Chat? get() = asPossiblyForwardedMessage() ?.forwardInfo ?.asForwardFromPublicChatInfo() ?.chat @RiskFeature(RawFieldsUsageWarning) inline val Message.forward_from_message_id: MessageId? - get() = asPossiblyForwardedMessage() ?.forwardInfo ?.asForwardFromChannelInfo() ?.messageId + get() = asPossiblyForwardedMessage() ?.forwardInfo ?.fromChannelOrNull() ?.messageId @RiskFeature(RawFieldsUsageWarning) inline val Message.forward_signature: ForwardSignature? - get() = asPossiblyForwardedMessage() ?.forwardInfo ?.asForwardFromChannelInfo() ?.signature + get() = asPossiblyForwardedMessage() ?.forwardInfo ?.fromChannelOrNull() ?.signature @RiskFeature(RawFieldsUsageWarning) inline val Message.forward_sender_name: ForwardSenderName? get() = asPossiblyForwardedMessage() ?.forwardInfo ?.asAnonymousForwardInfo() ?.senderName diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/EntitiesBuilder.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/EntitiesBuilder.kt deleted file mode 100644 index 3c8f597ac9..0000000000 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/EntitiesBuilder.kt +++ /dev/null @@ -1,639 +0,0 @@ -@file:Suppress("NOTHING_TO_INLINE", "unused") - -package dev.inmo.tgbotapi.extensions.utils.formatting - -import dev.inmo.micro_utils.common.joinTo -import dev.inmo.tgbotapi.types.CustomEmojiId -import dev.inmo.tgbotapi.types.chat.User -import dev.inmo.tgbotapi.types.message.textsources.* -import dev.inmo.tgbotapi.utils.EntitiesBuilderBody -import dev.inmo.tgbotapi.utils.RiskFeature - -private const val ReplacedInCoreModuleReason = "Replaced in core module" -private const val CoreModulePackage = "dev.inmo.tgbotapi.utils" - -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("EntitiesBuilderBody", "$CoreModulePackage.EntitiesBuilderBody")) -typealias EntitiesBuilderBody = EntitiesBuilderBody -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("newLine", "$CoreModulePackage.newLine")) -val newLine = dev.inmo.tgbotapi.utils.newLine - -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("buildEntities(separator, init)", "$CoreModulePackage.buildEntities")) -inline fun buildEntities(separator: TextSource? = null, init: EntitiesBuilderBody): TextSourcesList = dev.inmo.tgbotapi.utils.buildEntities(separator, init) -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("buildEntities(separator, init)", "$CoreModulePackage.buildEntities")) -inline fun buildEntities(separator: String, init: EntitiesBuilderBody) = dev.inmo.tgbotapi.utils.buildEntities(regular(separator), init) - -/** - * This builder can be used to provide building of [TextSource]s [List] - * - * @see buildEntities - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("EntitiesBuilder", "$CoreModulePackage.EntitiesBuilder")) -typealias EntitiesBuilder = dev.inmo.tgbotapi.utils.EntitiesBuilder - -/** - * Add bold using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.bold] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("bold(parts)", "$CoreModulePackage.bold")) -inline fun EntitiesBuilder.bold(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.bold(parts)) -/** - * Version of [EntitiesBuilder.bold] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("boldln(parts)", "$CoreModulePackage.boldln")) -inline fun EntitiesBuilder.boldln(parts: TextSourcesList) = bold(parts) + newLine -/** - * Add bold using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.bold]. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("bold(init)", "$CoreModulePackage.bold")) -inline fun EntitiesBuilder.bold(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.bold( - buildEntities(separator, init) -)) -/** - * Version of [EntitiesBuilder.bold] with new line at the end. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("boldln(init)", "$CoreModulePackage.boldln")) -inline fun EntitiesBuilder.boldln(noinline init: EntitiesBuilderBody) = bold(init) + newLine -/** - * Add bold using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.bold] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("bold(parts)", "$CoreModulePackage.bold")) -inline fun EntitiesBuilder.bold(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.bold(*parts)) -/** - * Version of [EntitiesBuilder.bold] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("boldln(parts)", "$CoreModulePackage.boldln")) -inline fun EntitiesBuilder.boldln(vararg parts: TextSource) = bold(*parts) + newLine -/** - * Add bold using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.bold] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("bold(text)", "$CoreModulePackage.bold")) -inline fun EntitiesBuilder.bold(text: String) = add(dev.inmo.tgbotapi.types.message.textsources.bold(text)) -/** - * Version of [EntitiesBuilder.bold] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("boldln(text)", "$CoreModulePackage.boldln")) -inline fun EntitiesBuilder.boldln(text: String) = bold(text) + newLine - -/** - * Add spoiler using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.spoiler] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("spoiler(parts)", "$CoreModulePackage.spoiler")) -inline fun EntitiesBuilder.spoiler(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.spoiler(parts)) -/** - * Version of [EntitiesBuilder.spoiler] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("spoilerln(parts)", "$CoreModulePackage.spoilerln")) -inline fun EntitiesBuilder.spoilerln(parts: TextSourcesList) = spoiler(parts) + newLine -/** - * Add spoiler using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.spoiler]. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("spoiler(init)", "$CoreModulePackage.spoiler")) -inline fun EntitiesBuilder.spoiler(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.spoiler( - buildEntities(separator, init) -)) -/** - * Version of [EntitiesBuilder.spoiler] with new line at the end. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("spoilerln(init)", "$CoreModulePackage.spoilerln")) -inline fun EntitiesBuilder.spoilerln(noinline init: EntitiesBuilderBody) = spoiler(init) + newLine -/** - * Add spoiler using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.spoiler] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("spoiler(parts)", "$CoreModulePackage.spoiler")) -inline fun EntitiesBuilder.spoiler(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.spoiler(*parts)) -/** - * Version of [EntitiesBuilder.spoiler] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("spoilerln(parts)", "$CoreModulePackage.spoilerln")) -inline fun EntitiesBuilder.spoilerln(vararg parts: TextSource) = spoiler(*parts) + newLine -/** - * Add spoiler using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.spoiler] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("spoiler(text)", "$CoreModulePackage.spoiler")) -inline fun EntitiesBuilder.spoiler(text: String) = add(dev.inmo.tgbotapi.types.message.textsources.spoiler(text)) -/** - * Version of [EntitiesBuilder.spoiler] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("spoilerln(text)", "$CoreModulePackage.spoilerln")) -inline fun EntitiesBuilder.spoilerln(text: String) = spoiler(text) + newLine - - -/** - * Add botCommand using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.botCommand] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("botCommand(command)", "$CoreModulePackage.botCommand")) -inline fun EntitiesBuilder.botCommand(command: String) = add(dev.inmo.tgbotapi.types.message.textsources.botCommand(command)) -/** - * Version of [EntitiesBuilder.botCommand] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("botCommandln(command)", "$CoreModulePackage.botCommandln")) -inline fun EntitiesBuilder.botCommandln(command: String) = botCommand(command) + newLine - - -/** - * Add cashTag using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.cashTag] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("cashTag(parts)", "$CoreModulePackage.cashTag")) -inline fun EntitiesBuilder.cashTag(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.cashTag(parts)) -/** - * Version of [EntitiesBuilder.cashTag] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("cashTagln(parts)", "$CoreModulePackage.cashTagln")) -inline fun EntitiesBuilder.cashTagln(parts: TextSourcesList) = cashTag(parts) + newLine -/** - * Add cashTag using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.cashTag]. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("cashTag(init)", "$CoreModulePackage.cashTag")) -inline fun EntitiesBuilder.cashTag(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.cashTag( - buildEntities(separator, init) -)) -/** - * Version of [EntitiesBuilder.cashTag] with new line at the end. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("cashTagln(init)", "$CoreModulePackage.cashTagln")) -inline fun EntitiesBuilder.cashTagln(noinline init: EntitiesBuilderBody) = cashTag(init) + newLine -/** - * Add cashTag using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.cashTag] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("cashTag(parts)", "$CoreModulePackage.cashTag")) -inline fun EntitiesBuilder.cashTag(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.cashTag(*parts)) -/** - * Version of [EntitiesBuilder.cashTag] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("cashTagln(parts)", "$CoreModulePackage.cashTagln")) -inline fun EntitiesBuilder.cashTagln(vararg parts: TextSource) = cashTag(*parts) + newLine -/** - * Add cashTag using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.cashTag] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("cashTag(text)", "$CoreModulePackage.cashTag")) -inline fun EntitiesBuilder.cashTag(text: String) = add(dev.inmo.tgbotapi.types.message.textsources.cashTag(text)) -/** - * Version of [EntitiesBuilder.cashTag] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("cashTagln(text)", "$CoreModulePackage.cashTagln")) -inline fun EntitiesBuilder.cashTagln(text: String) = cashTag(text) + newLine - - -/** - * Add code using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.code] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("code(code)", "$CoreModulePackage.code")) -inline fun EntitiesBuilder.code(code: String) = add(dev.inmo.tgbotapi.types.message.textsources.code(code)) -/** - * Version of [EntitiesBuilder.code] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("codeln(code)", "$CoreModulePackage.codeln")) -inline fun EntitiesBuilder.codeln(code: String) = code(code) + newLine - - -/** - * Add email using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.email] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("email(parts)", "$CoreModulePackage.email")) -inline fun EntitiesBuilder.email(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.email(parts)) -/** - * Version of [EntitiesBuilder.email] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("emailln(parts)", "$CoreModulePackage.emailln")) -inline fun EntitiesBuilder.emailln(parts: TextSourcesList) = email(parts) + newLine -/** - * Add email using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.email]. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("email(init)", "$CoreModulePackage.email")) -inline fun EntitiesBuilder.email(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.email( - buildEntities(separator, init) -)) -/** - * Version of [EntitiesBuilder.email] with new line at the end. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("emailln(init)", "$CoreModulePackage.emailln")) -inline fun EntitiesBuilder.emailln(noinline init: EntitiesBuilderBody) = email(init) + newLine -/** - * Add email using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.email] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("email(parts)", "$CoreModulePackage.email")) -inline fun EntitiesBuilder.email(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.email(*parts)) -/** - * Version of [EntitiesBuilder.email] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("emailln(parts)", "$CoreModulePackage.emailln")) -inline fun EntitiesBuilder.emailln(vararg parts: TextSource) = email(*parts) + newLine -/** - * Add email using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.email] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("email(emailAddress)", "$CoreModulePackage.email")) -inline fun EntitiesBuilder.email(emailAddress: String) = add(dev.inmo.tgbotapi.types.message.textsources.email(emailAddress)) -/** - * Version of [EntitiesBuilder.email] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("emailln(emailAddress)", "$CoreModulePackage.emailln")) -inline fun EntitiesBuilder.emailln(emailAddress: String) = email(emailAddress) + newLine - - -/** - * Add hashtag using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.hashtag] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("hashtag(parts)", "$CoreModulePackage.hashtag")) -inline fun EntitiesBuilder.hashtag(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.hashtag(parts)) -/** - * Version of [EntitiesBuilder.hashtag] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("hashtagln(parts)", "$CoreModulePackage.hashtagln")) -inline fun EntitiesBuilder.hashtagln(parts: TextSourcesList) = hashtag(parts) + newLine -/** - * Add hashtag using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.hashtag]. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("hashtag(init)", "$CoreModulePackage.hashtag")) -inline fun EntitiesBuilder.hashtag(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.hashtag( - buildEntities(separator, init) -)) -/** - * Version of [EntitiesBuilder.hashtag] with new line at the end. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("hashtagln(init)", "$CoreModulePackage.hashtagln")) -inline fun EntitiesBuilder.hashtagln(noinline init: EntitiesBuilderBody) = hashtag(init) + newLine -/** - * Add hashtag using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.hashtag] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("hashtag(parts)", "$CoreModulePackage.hashtag")) -inline fun EntitiesBuilder.hashtag(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.hashtag(*parts)) -/** - * Version of [EntitiesBuilder.hashtag] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("hashtagln(parts)", "$CoreModulePackage.hashtagln")) -inline fun EntitiesBuilder.hashtagln(vararg parts: TextSource) = hashtag(*parts) + newLine -/** - * Add hashtag using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.hashtag] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("hashtag(hashtag)", "$CoreModulePackage.hashtag")) -inline fun EntitiesBuilder.hashtag(hashtag: String) = add(dev.inmo.tgbotapi.types.message.textsources.hashtag(hashtag)) -/** - * Version of [EntitiesBuilder.hashtag] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("hashtagln(hashtag)", "$CoreModulePackage.hashtagln")) -inline fun EntitiesBuilder.hashtagln(hashtag: String) = hashtag(hashtag) + newLine - - -/** - * Add italic using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.italic] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("italic(parts)", "$CoreModulePackage.italic")) -inline fun EntitiesBuilder.italic(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.italic(parts)) -/** - * Version of [EntitiesBuilder.italic] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("italicln(parts)", "$CoreModulePackage.italicln")) -inline fun EntitiesBuilder.italicln(parts: TextSourcesList) = italic(parts) + newLine -/** - * Add italic using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.italic]. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("italic(init)", "$CoreModulePackage.italic")) -inline fun EntitiesBuilder.italic(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.italic( - buildEntities(separator, init) -)) -/** - * Version of [EntitiesBuilder.italic] with new line at the end. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("italicln(init)", "$CoreModulePackage.italicln")) -inline fun EntitiesBuilder.italicln(noinline init: EntitiesBuilderBody) = italic(init) + newLine -/** - * Add italic using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.italic] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("italic(parts)", "$CoreModulePackage.italic")) -inline fun EntitiesBuilder.italic(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.italic(*parts)) -/** - * Version of [EntitiesBuilder.italic] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("italicln(parts)", "$CoreModulePackage.italicln")) -inline fun EntitiesBuilder.italicln(vararg parts: TextSource) = italic(*parts) + newLine -/** - * Add italic using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.italic] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("italic(text)", "$CoreModulePackage.italic")) -inline fun EntitiesBuilder.italic(text: String) = add(dev.inmo.tgbotapi.types.message.textsources.italic(text)) -/** - * Version of [EntitiesBuilder.italic] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("italicln(text)", "$CoreModulePackage.italicln")) -inline fun EntitiesBuilder.italicln(text: String) = italic(text) + newLine - - -/** - * Add mention using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.mention] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mention(parts)", "$CoreModulePackage.mention")) -inline fun EntitiesBuilder.mention(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.mention(parts)) -/** - * Version of [EntitiesBuilder.mention] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mentionln(parts)", "$CoreModulePackage.mentionln")) -inline fun EntitiesBuilder.mentionln(parts: TextSourcesList) = mention(parts) + newLine -/** - * Add mention using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.mention]. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mention(init)", "$CoreModulePackage.mention")) -inline fun EntitiesBuilder.mention(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.mention( - buildEntities(separator, init) -)) -/** - * Version of [EntitiesBuilder.mention] with new line at the end. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mentionln(init)", "$CoreModulePackage.mentionln")) -inline fun EntitiesBuilder.mentionln(noinline init: EntitiesBuilderBody) = mention(init) + newLine -/** - * Add mention using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.mention] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mention(parts)", "$CoreModulePackage.mention")) -inline fun EntitiesBuilder.mention(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.mention(*parts)) -/** - * Version of [EntitiesBuilder.mention] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mentionln(parts)", "$CoreModulePackage.mentionln")) -inline fun EntitiesBuilder.mentionln(vararg parts: TextSource) = mention(*parts) + newLine -/** - * Add mention using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.mention] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mention(whoToMention)", "$CoreModulePackage.mention")) -inline fun EntitiesBuilder.mention(whoToMention: String) = add(dev.inmo.tgbotapi.types.message.textsources.mention(whoToMention)) -/** - * Version of [EntitiesBuilder.mention] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mentionln(whoToMention)", "$CoreModulePackage.mentionln")) -inline fun EntitiesBuilder.mentionln(whoToMention: String) = mention(whoToMention) + newLine -/** - * Add mention using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.mention] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mention(parts)", "$CoreModulePackage.mention")) -inline fun EntitiesBuilder.mention(parts: TextSourcesList, user: User) = add(dev.inmo.tgbotapi.types.message.textsources.mention(parts, user)) -/** - * Version of [EntitiesBuilder.mention] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mentionln(parts, user)", "$CoreModulePackage.mentionln")) -inline fun EntitiesBuilder.mentionln(parts: TextSourcesList, user: User) = mention(parts) + newLine -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mention(user, parts)", "$CoreModulePackage.mention")) -inline fun EntitiesBuilder.mention( - user: User, - vararg parts: TextSource -) = add(dev.inmo.tgbotapi.types.message.textsources.mention(user, *parts)) -/** - * Version of [EntitiesBuilder.mention] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mentionln(user, parts)", "$CoreModulePackage.mentionln")) -inline fun EntitiesBuilder.mentionln(user: User, vararg parts: TextSource) = mention(user, *parts) + newLine -/** - * Add mention using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.mention] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mention(text, user)", "$CoreModulePackage.mention")) -inline fun EntitiesBuilder.mention(text: String, user: User) = add(dev.inmo.tgbotapi.types.message.textsources.mention(text, user)) -/** - * Version of [EntitiesBuilder.mention] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("mentionln(text, user)", "$CoreModulePackage.mentionln")) -inline fun EntitiesBuilder.mentionln(text: String, user: User) = mention(text) + newLine - - -/** - * Add phone using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.phone] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("phone(parts)", "$CoreModulePackage.phone")) -inline fun EntitiesBuilder.phone(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.phone(parts)) -/** - * Version of [EntitiesBuilder.phone] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("phoneln(parts)", "$CoreModulePackage.phoneln")) -inline fun EntitiesBuilder.phoneln(parts: TextSourcesList) = phone(parts) + newLine -/** - * Add phone using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.phone]. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("phone(init)", "$CoreModulePackage.phone")) -inline fun EntitiesBuilder.phone(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.phone( - buildEntities(separator, init) -)) -/** - * Version of [EntitiesBuilder.phone] with new line at the end. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("phoneln(init)", "$CoreModulePackage.phoneln")) -inline fun EntitiesBuilder.phoneln(noinline init: EntitiesBuilderBody) = phone(init) + newLine -/** - * Add phone using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.phone] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("phone(parts)", "$CoreModulePackage.phone")) -inline fun EntitiesBuilder.phone(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.phone(*parts)) -/** - * Version of [EntitiesBuilder.phone] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("phoneln(parts)", "$CoreModulePackage.phoneln")) -inline fun EntitiesBuilder.phoneln(vararg parts: TextSource) = phone(*parts) + newLine -/** - * Add phone using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.phone] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("phone(number)", "$CoreModulePackage.phone")) -inline fun EntitiesBuilder.phone(number: String) = add(dev.inmo.tgbotapi.types.message.textsources.phone(number)) -/** - * Version of [EntitiesBuilder.phone] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("phoneln(number)", "$CoreModulePackage.phoneln")) -inline fun EntitiesBuilder.phoneln(number: String) = phone(number) + newLine - - -/** - * Add pre using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.pre] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("pre(code, language)", "$CoreModulePackage.pre")) -inline fun EntitiesBuilder.pre(code: String, language: String?) = add(dev.inmo.tgbotapi.types.message.textsources.pre(code, language)) -/** - * Version of [EntitiesBuilder.pre] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("preln(code, language)", "$CoreModulePackage.preln")) -inline fun EntitiesBuilder.preln(code: String, language: String?) = pre(code) + newLine - -/** - * Will add simple [dev.inmo.tgbotapi.types.message.textsources.regular] [TextSource] - * - * @see RegularTextSource - * @see dev.inmo.tgbotapi.extensions.utils.formatting.regularln - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("regular(text)", "$CoreModulePackage.regular")) -inline fun EntitiesBuilder.regular(text: String) = - add(dev.inmo.tgbotapi.types.message.textsources.regular(text)) -/** - * Will add simple [dev.inmo.tgbotapi.types.message.textsources.regular] [TextSource] and "\n" at the end - * - * @see RegularTextSource - * @see dev.inmo.tgbotapi.extensions.utils.formatting.regular - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("regularln(text)", "$CoreModulePackage.regularln")) -inline fun EntitiesBuilder.regularln(text: String) = regular(text) + newLine - - -/** - * Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethrough] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("strikethrough(parts)", "$CoreModulePackage.strikethrough")) -inline fun EntitiesBuilder.strikethrough(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.strikethrough(parts)) -/** - * Version of [EntitiesBuilder.strikethrough] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("strikethroughln(parts)", "$CoreModulePackage.strikethroughln")) -inline fun EntitiesBuilder.strikethroughln(parts: TextSourcesList) = strikethrough(parts) + newLine -/** - * Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethrough]. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("strikethrough(init)", "$CoreModulePackage.strikethrough")) -inline fun EntitiesBuilder.strikethrough(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.strikethrough( - buildEntities(separator, init) -)) -/** - * Version of [EntitiesBuilder.strikethrough] with new line at the end. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("strikethroughln(init)", "$CoreModulePackage.strikethroughln")) -inline fun EntitiesBuilder.strikethroughln(noinline init: EntitiesBuilderBody) = strikethrough(init) + newLine -/** - * Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethrough] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("strikethrough(parts)", "$CoreModulePackage.strikethrough")) -inline fun EntitiesBuilder.strikethrough(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.strikethrough(*parts)) -/** - * Version of [EntitiesBuilder.strikethrough] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("strikethroughln(parts)", "$CoreModulePackage.strikethroughln")) -inline fun EntitiesBuilder.strikethroughln(vararg parts: TextSource) = strikethrough(*parts) + newLine -/** - * Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethrough] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("strikethrough(text)", "$CoreModulePackage.strikethrough")) -inline fun EntitiesBuilder.strikethrough(text: String) = add(dev.inmo.tgbotapi.types.message.textsources.strikethrough(text)) -/** - * Version of [EntitiesBuilder.strikethrough] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("strikethroughln(text)", "$CoreModulePackage.strikethroughln")) -inline fun EntitiesBuilder.strikethroughln(text: String) = strikethrough(text) + newLine - - -/** - * Add link using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.link] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("link(text, url)", "$CoreModulePackage.link")) -inline fun EntitiesBuilder.link(text: String, url: String) = add(dev.inmo.tgbotapi.types.message.textsources.link(text, url)) -/** - * Version of [EntitiesBuilder.link] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("linkln(text, url)", "$CoreModulePackage.linkln")) -inline fun EntitiesBuilder.linkln(text: String, url: String) = link(text, url) + newLine -/** - * Add link using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.link] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("link(url)", "$CoreModulePackage.link")) -inline fun EntitiesBuilder.link(url: String) = add(dev.inmo.tgbotapi.types.message.textsources.link(url)) -/** - * Version of [EntitiesBuilder.link] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("linkln(url)", "$CoreModulePackage.linkln")) -inline fun EntitiesBuilder.linkln(url: String) = link(url) + newLine - - -/** - * Add underline using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.underline] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("underline(parts)", "$CoreModulePackage.underline")) -inline fun EntitiesBuilder.underline(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.underline(parts)) -/** - * Version of [EntitiesBuilder.underline] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("underlineln(parts)", "$CoreModulePackage.underlineln")) -inline fun EntitiesBuilder.underlineln(parts: TextSourcesList) = underline(parts) + newLine -/** - * Add underline using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.underline]. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("underline(init)", "$CoreModulePackage.underline")) -inline fun EntitiesBuilder.underline(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.underline( - buildEntities(separator, init) -)) -/** - * Version of [EntitiesBuilder.underline] with new line at the end. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("underlineln(init)", "$CoreModulePackage.underlineln")) -inline fun EntitiesBuilder.underlineln(noinline init: EntitiesBuilderBody) = underline(init) + newLine -/** - * Add underline using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.underline] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("underline(parts)", "$CoreModulePackage.underline")) -inline fun EntitiesBuilder.underline(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.underline(*parts)) -/** - * Version of [EntitiesBuilder.underline] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("underlineln(parts)", "$CoreModulePackage.underlineln")) -inline fun EntitiesBuilder.underlineln(vararg parts: TextSource) = underline(*parts) + newLine -/** - * Add underline using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.underline] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("underline(text)", "$CoreModulePackage.underline")) -inline fun EntitiesBuilder.underline(text: String) = add(dev.inmo.tgbotapi.types.message.textsources.underline(text)) -/** - * Version of [EntitiesBuilder.underline] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("underlineln(text)", "$CoreModulePackage.underlineln")) -inline fun EntitiesBuilder.underlineln(text: String) = underline(text) + newLine - - -/** - * Add customEmoji using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.customEmoji] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("customEmoji(customEmojiId, parts)", "$CoreModulePackage.customEmoji")) -inline fun EntitiesBuilder.customEmoji(customEmojiId: CustomEmojiId, parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.customEmoji(customEmojiId, parts)) -/** - * Version of [EntitiesBuilder.customEmoji] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("customEmojiln(customEmojiId, parts)", "$CoreModulePackage.customEmojiln")) -inline fun EntitiesBuilder.customEmojiln(customEmojiId: CustomEmojiId, parts: TextSourcesList) = customEmoji(customEmojiId, parts) + newLine -/** - * Add customEmoji using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.customEmoji]. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("customEmoji(customEmojiId, init)", "$CoreModulePackage.customEmoji")) -inline fun EntitiesBuilder.customEmoji(customEmojiId: CustomEmojiId, noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.customEmoji(customEmojiId, buildEntities(separator, init))) -/** - * Version of [EntitiesBuilder.customEmoji] with new line at the end. - * Will reuse separator config from [buildEntities] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("customEmojiln(customEmojiId, init)", "$CoreModulePackage.customEmojiln")) -inline fun EntitiesBuilder.customEmojiln(customEmojiId: CustomEmojiId, noinline init: EntitiesBuilderBody) = customEmoji(customEmojiId, init) + newLine -/** - * Add customEmoji using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.customEmoji] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("customEmoji(customEmojiId, parts)", "$CoreModulePackage.customEmoji")) -inline fun EntitiesBuilder.customEmoji(customEmojiId: CustomEmojiId, vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.customEmoji(customEmojiId, *parts)) -/** - * Version of [EntitiesBuilder.customEmoji] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("customEmojiln(customEmojiId, parts)", "$CoreModulePackage.customEmojiln")) -inline fun EntitiesBuilder.customEmojiln(customEmojiId: CustomEmojiId, vararg parts: TextSource) = customEmoji(customEmojiId, *parts) + newLine -/** - * Add customEmoji using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.customEmoji] - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("customEmoji(customEmojiId, text)", "$CoreModulePackage.customEmoji")) -inline fun EntitiesBuilder.customEmoji(customEmojiId: CustomEmojiId, text: String) = add(dev.inmo.tgbotapi.types.message.textsources.customEmoji(customEmojiId, text)) -/** - * Version of [EntitiesBuilder.customEmoji] with new line at the end - */ -@Deprecated(ReplacedInCoreModuleReason, ReplaceWith("customEmojiln(customEmojiId, text)", "$CoreModulePackage.customEmojiln")) -inline fun EntitiesBuilder.customEmojiln(customEmojiId: CustomEmojiId, text: String) = customEmoji(customEmojiId, text) + newLine diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt index bb354096f3..6a8e9d4c30 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt @@ -20,14 +20,8 @@ fun makeUsernameStartattachPrefix(username: String) = "$internalLinkBeginning/$u fun makeUsernameStartattachLink(username: String, data: String? = null) = "${makeUsernameStartattachPrefix(username)}${data?.let { "=$it" } ?: ""}" inline val Username.usernameLink get() = makeUsernameLink(usernameWithoutAt) -@Deprecated("Deprecated due to the conflicts in name", ReplaceWith("this.usernameLink", "dev.inmo.tgbotapi.extensions.utils.formatting.usernameLink")) -inline val Username.link - get() = usernameLink val IdChatIdentifier.chatLink: String get() = makeChatLink(chatId, threadId) -@Deprecated("Deprecated due to the conflicts in name", ReplaceWith("this.chatLink", "dev.inmo.tgbotapi.extensions.utils.formatting.chatLink")) -val IdChatIdentifier.link: String - get() = chatLink fun ChatId.link(threadId: MessageThreadId?) = makeChatLink(chatId, threadId) inline fun Username.link(threadId: MessageThreadId?) = makeUsernameLink(usernameWithoutAt, threadId) inline val Username.deepLinkPrefix @@ -95,13 +89,6 @@ val Message.messageLink: String? messageId ) -/** - * @see makeLinkToMessage - */ -@Deprecated("Deprecated due to the conflicts in name", ReplaceWith("this.messageLink", "dev.inmo.tgbotapi.extensions.utils.formatting.messageLink")) -val Message.link: String? - get() = messageLink - /** * Link which can be used as by any user to get access to [Chat]. Returns null in case when there are no * known way to build link @@ -120,14 +107,6 @@ val Chat.chatLink: String? return null } -/** - * Link which can be used as by any user to get access to [Chat]. Returns null in case when there are no - * known way to build link - */ -@Deprecated("Deprecated due to the conflicts in name", ReplaceWith("this.chatLink", "dev.inmo.tgbotapi.extensions.utils.formatting.chatLink")) -val Chat.link: String? - get() = chatLink - private const val stickerSetAddingLinkPrefix = "$internalLinkBeginning/addstickers" val StickerSetName.stickerSetLink diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt index dbab023d4c..93255bcf59 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt @@ -72,8 +72,8 @@ inline fun Flow>.deletedGroupPhotoEvents() = filterGroupEven inline fun FlowsUpdatesFilter.deletedGroupPhotoEvents() = filterGroupEvents() inline fun Flow>.newGroupMembersEvents() = filterGroupEvents() inline fun FlowsUpdatesFilter.newGroupMembersEvents() = filterGroupEvents() -inline fun Flow>.leftGroupMemberEvents() = filterGroupEvents() -inline fun FlowsUpdatesFilter.leftGroupMemberEvents() = filterGroupEvents() +inline fun Flow>.leftGroupMemberEvents() = filterGroupEvents() +inline fun FlowsUpdatesFilter.leftGroupMemberEvents() = filterGroupEvents() inline fun Flow>.newGroupPhotoEvents() = filterGroupEvents() inline fun FlowsUpdatesFilter.newGroupPhotoEvents() = filterGroupEvents() inline fun Flow>.newGroupTitleEvents() = filterGroupEvents() @@ -97,8 +97,8 @@ inline fun Flow>.deletedSupergroupPhotoEvents() = filterSupe inline fun FlowsUpdatesFilter.deletedSupergroupPhotoEvents() = filterSupergroupEvents() inline fun Flow>.newSupergroupMembersEvents() = filterSupergroupEvents() inline fun FlowsUpdatesFilter.newSupergroupMembersEvents() = filterSupergroupEvents() -inline fun Flow>.leftSupergroupMemberEvents() = filterSupergroupEvents() -inline fun FlowsUpdatesFilter.leftSupergroupMemberEvents() = filterSupergroupEvents() +inline fun Flow>.leftSupergroupMemberEvents() = filterSupergroupEvents() +inline fun FlowsUpdatesFilter.leftSupergroupMemberEvents() = filterSupergroupEvents() inline fun Flow>.newSupergroupPhotoEvents() = filterSupergroupEvents() inline fun FlowsUpdatesFilter.newSupergroupPhotoEvents() = filterSupergroupEvents() inline fun Flow>.newSupergroupTitleEvents() = filterSupergroupEvents() diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/InlineKeyboardBuilder.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/InlineKeyboardBuilder.kt index 69037b21e3..06e844e9e1 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/InlineKeyboardBuilder.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/InlineKeyboardBuilder.kt @@ -49,21 +49,6 @@ inline fun flatInlineKeyboard( block: InlineKeyboardRowBuilder.() -> Unit ) = inlineKeyboard { row(block) } -/** - * Creates an [InlineKeyboardRowBuilder] and [apply] [block] with this builder - * - * @see payButton - * @see dataButton - * @see gameButton - * @see loginButton - * @see inlineQueryInCurrentChatButton - * @see inlineQueryButton - * @see urlButton - */ -@Deprecated("Redundant", ReplaceWith("this.row(block)", "dev.inmo.tgbotapi.utils.row")) -inline fun InlineKeyboardBuilder.row( - block: InlineKeyboardRowBuilder.() -> Unit -) = add(InlineKeyboardRowBuilder().apply(block).row) /** * Creates and put [PayInlineKeyboardButton] diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt index 22acc0e117..3720c54e82 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt @@ -67,19 +67,6 @@ inline fun flatReplyKeyboard( row(block) } -/** - * Creates an [ReplyKeyboardRowBuilder] and [apply] [block] with this builder - * - * @see simpleButton - * @see requestContactButton - * @see requestLocationButton - * @see requestPollButton - */ -@Deprecated("Redundant", ReplaceWith("this.row(block)", "dev.inmo.tgbotapi.utils.row")) -inline fun ReplyKeyboardBuilder.row( - block: ReplyKeyboardRowBuilder.() -> Unit -) = add(ReplyKeyboardRowBuilder().apply(block).row) - /** * Creates and put [SimpleKeyboardButton] * diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/UpdatesUtils.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/UpdatesUtils.kt index 83757480d8..add4bcbefe 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/UpdatesUtils.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/UpdatesUtils.kt @@ -9,14 +9,6 @@ import dev.inmo.tgbotapi.types.update.* import dev.inmo.tgbotapi.types.update.abstracts.* import dev.inmo.tgbotapi.utils.extensions.asMediaGroupMessage -/** - * @return If [this] is [SentMediaGroupUpdate] - [Update.updateId] of [last] element, or its own [Update.updateId] - */ -@Deprecated("Redundant", ReplaceWith("updateId")) -fun Update.lastUpdateIdentifier(): UpdateIdentifier { - return updateId -} - /** * @return The biggest [UpdateIdentifier] OR null * @@ -61,12 +53,3 @@ fun List.convertWithMediaGroupUpdates(): List { resultUpdates.sortBy { it.updateId } return resultUpdates } - -/** - * @return [EditMessageMediaGroupUpdate] in case if [this] is [EditMessageUpdate]. When [this] object is - * [EditChannelPostUpdate] instance - will return [EditChannelPostMediaGroupUpdate] - * - * @throws IllegalStateException - */ -@Deprecated("Redundant", ReplaceWith("this")) -fun BaseEditMessageUpdate.toEditMediaGroupUpdate() = this