diff --git a/.github/workflows/packages_publishing.yml b/.github/workflows/packages_publishing.yml index 233fc307b8..fe93346a45 100644 --- a/.github/workflows/packages_publishing.yml +++ b/.github/workflows/packages_publishing.yml @@ -16,7 +16,12 @@ jobs: mv gradle.properties.tmp gradle.properties - name: Build run: ./gradlew build - - name: Publish + - name: Publish to Gitea + continue-on-error: true + run: ./gradlew publishAllPublicationsToGiteaRepository + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + - name: Publish to GithubPackages continue-on-error: true run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel env: diff --git a/CHANGELOG.md b/CHANGELOG.md index bdca437db9..7882629174 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # TelegramBotAPI changelog +## 4.1.3 + +* `Versions`: + * `MicroUtils`: `0.14.2` -> `0.14.4` +* `Core`: + * `ContentMessage`, `CommonMessage`, `PossiblyMediaGroupMessage` and `PossiblySentViaBotCommonMessage` got `out` + variance + * `UserId` now is `ChatId` instead of `IdChatIdentififer` + ## 4.1.2 * `Versions`: diff --git a/gradle.properties b/gradle.properties index 4a82cfd28a..35ee527971 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=4.1.2 +library_version=4.1.3 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index da0f7dfac8..8174ed62df 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ ktor = "2.1.3" ksp = "1.7.21-1.0.8" kotlin-poet = "1.12.0" -microutils = "0.14.2" +microutils = "0.14.4" github-release-plugin = "2.4.1" dokka = "1.7.20" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt index 0f81141a77..9b8eedeb5e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt @@ -69,9 +69,9 @@ val UserId.userLink: String val User.link: String get() = id.userLink -typealias UserId = IdChatIdentifier +typealias UserId = ChatId -fun Identifier.toChatId(): IdChatIdentifier = ChatId(this) +fun Identifier.toChatId(): ChatId = ChatId(this) fun Int.toChatId(): IdChatIdentifier = toLong().toChatId() fun Byte.toChatId(): IdChatIdentifier = toLong().toChatId() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt index 20ed573d34..5c93f6ea71 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt @@ -52,7 +52,7 @@ data class ExtendedGroupChatImpl( @Serializable data class ExtendedPrivateChatImpl( @SerialName(idField) - override val id: IdChatIdentifier, + override val id: UserId, @SerialName(photoField) override val chatPhoto: ChatPhoto? = null, @SerialName(usernameField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Impls.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Impls.kt index e329c3b015..fa1a075ace 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Impls.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Impls.kt @@ -18,7 +18,7 @@ data class GroupChatImpl( @Serializable data class PrivateChatImpl( @SerialName(idField) - override val id: IdChatIdentifier, + override val id: UserId, @SerialName(usernameField) override val username: Username? = null, @SerialName(firstNameField) 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 5df612670a..26a66f446f 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 @@ -42,6 +42,7 @@ sealed interface Sticker : TelegramMediaFile, SizedMediaFile, ThumbedMediaFile { get() = false } +@OptIn(RiskFeature::class) object StickerSerializer : KSerializer { override val descriptor: SerialDescriptor = StickerSurrogate.serializer().descriptor diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/CommonMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/CommonMessage.kt index 7adf185282..a5bc9b83aa 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/CommonMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/CommonMessage.kt @@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.types.message.abstracts import dev.inmo.tgbotapi.types.message.content.MessageContent -sealed interface CommonMessage : Message, +sealed interface CommonMessage : Message, PossiblyForwardedMessage, PossiblyEditedMessage, PossiblyReplyMessage, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ContentMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ContentMessage.kt index 7c4d04172b..cfed7358dc 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ContentMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ContentMessage.kt @@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.types.message.abstracts import dev.inmo.tgbotapi.types.message.content.MessageContent -interface ContentMessage: Message { +interface ContentMessage: Message { val hasProtectedContent: Boolean val content: T diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/PossiblyMediaGroupMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/PossiblyMediaGroupMessage.kt index fa865da83b..47bffba82f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/PossiblyMediaGroupMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/PossiblyMediaGroupMessage.kt @@ -3,6 +3,6 @@ package dev.inmo.tgbotapi.types.message.abstracts import dev.inmo.tgbotapi.types.MediaGroupIdentifier import dev.inmo.tgbotapi.types.message.content.MessageContent -interface PossiblyMediaGroupMessage : ContentMessage { +interface PossiblyMediaGroupMessage : ContentMessage { val mediaGroupId: MediaGroupIdentifier? } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/PossiblySentViaBotCommonMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/PossiblySentViaBotCommonMessage.kt index 5b7574457d..18613df71f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/PossiblySentViaBotCommonMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/PossiblySentViaBotCommonMessage.kt @@ -2,4 +2,4 @@ package dev.inmo.tgbotapi.types.message.abstracts import dev.inmo.tgbotapi.types.message.content.MessageContent -sealed interface PossiblySentViaBotCommonMessage : CommonMessage, PossiblySentViaBot +sealed interface PossiblySentViaBotCommonMessage : CommonMessage, PossiblySentViaBot diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt index 493870f3e0..21f3279b4c 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt @@ -200,7 +200,7 @@ infix fun String.mention(parseMode: ParseMode): String = when (parseMode) { is MarkdownV2 -> mentionMarkdownV2() } -infix fun Pair.mention(parseMode: ParseMode): String = when (parseMode) { +infix fun Pair.mention(parseMode: ParseMode): String = when (parseMode) { is HTML -> first.textMentionHTML(second) is Markdown -> first.textMentionMarkdown(second) is MarkdownV2 -> first.textMentionMarkdownV2(second)