diff --git a/CHANGELOG.md b/CHANGELOG.md index ee162ce3c4..7ac6e0f1f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,23 @@ ## 17.0.0 +**THIS UPDATE CONTAINS SUPPORT OF BOTS API 7.9** + +* Add support of subscriptions links handling +* Add support of info about sender chat. **It is important, that for channels will be actual `senderChat` instead of +`from` field due to `User` type of the last one**. You also may use extensions `Message.sender_chat` or `Any.withSenderChatMessageOrNull` +to access sender chat +* Add `Reaction.Paid` + +Additional changes: + +* `Core`: + * Add top level interfaces `OptionallyWithUser` and `OptionallyFromUser`. Old `WithUser` and `FromUser` interfaces + extending them with following overrides of `user` and `from` fields * `API`: * Change order of delay and sending action in [SendActionDSL](tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt) - (thanks to [DRSchlaubi](https://github.com/DRSchlaubi), [PR #833](https://github.com/InsanusMokrassar/ktgbotapi/pull/883)) + (thanks to [DRSchlaubi](https://github.com/DRSchlaubi), [PR #833](https://github.com/InsanusMokrassar/ktgbotapi/pull/883)). + Besides, there has been changed way to create parallel sending of action and it must not lead to memory leaks anymore ## 16.0.0 diff --git a/README.md b/README.md index 5ee6e4837c..711fce10ff 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-7.8-blue)](https://core.telegram.org/bots/api-changelog#july-31-2024) +# 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-7.9-blue)](https://core.telegram.org/bots/api-changelog#august-14-2024) | 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=Mk&message=Docs&color=blue&logo=mkdocs)](https://docs.inmo.dev/tgbotapi/index.html) | |:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index fcb683fe34..7f0653eafb 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -25224,14 +25224,12 @@ public final class dev/inmo/tgbotapi/types/reactions/Reaction$Emoji$Companion { } public final class dev/inmo/tgbotapi/types/reactions/Reaction$Paid : dev/inmo/tgbotapi/types/reactions/Reaction { - public static final field Companion Ldev/inmo/tgbotapi/types/reactions/Reaction$Paid$Companion; - public static final field type Ljava/lang/String; - public fun ()V + public static final field INSTANCE Ldev/inmo/tgbotapi/types/reactions/Reaction$Paid; + public fun equals (Ljava/lang/Object;)Z public fun getType ()Ljava/lang/String; -} - -public final class dev/inmo/tgbotapi/types/reactions/Reaction$Paid$Companion { + public fun hashCode ()I public final fun serializer ()Lkotlinx/serialization/KSerializer; + public fun toString ()Ljava/lang/String; } public final class dev/inmo/tgbotapi/types/reactions/Reaction$Unknown : dev/inmo/tgbotapi/types/reactions/Reaction { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt index 3ceb370dd5..c1057d8447 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt @@ -44,12 +44,9 @@ sealed interface Reaction { } @Serializable(Reaction.Companion::class) - class Paid : Reaction { + data object Paid : Reaction { override val type: String - get() = Companion.type - companion object { - const val type: String = "paid" - } + get() = "paid" } @Serializable(Reaction.Companion::class) @@ -82,7 +79,7 @@ sealed interface Reaction { return when { surrogate.emoji != null -> Emoji(surrogate.emoji) surrogate.customEmojiId != null -> CustomEmoji(surrogate.customEmojiId) - surrogate.type == Paid.type -> Paid() + surrogate.type == Paid.type -> Paid else -> Unknown(surrogate.type, json) } }