From 7668c48081c058b2e60bd6c7b1e1006919f9af84 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 13 Apr 2020 12:09:59 +0600 Subject: [PATCH] BaseEditMessageUpdate#data now is CommonMessage --- CHANGELOG.md | 1 + .../TelegramBotAPI/types/update/EditChannelPostUpdate.kt | 4 ++-- .../TelegramBotAPI/types/update/EditMessageUpdate.kt | 4 ++-- .../TelegramBotAPI/types/update/RawUpdate.kt | 6 +++--- .../types/update/abstracts/BaseEditMessageUpdate.kt | 6 +++++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3e2cb02d4..ad49ff4a32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ * `Update` now will be created even if was `SerializationException` inside of creating the update instance - in this case will be created `UnknownUpdateType` * `UnknownUpdateType$rawJson` value now is included (`JsonElement`) + * **EXPERIMENTALLY** `BaseEditMessageUpdate#data` now is `CommonMessage<*>` ### 0.26.2 diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/EditChannelPostUpdate.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/EditChannelPostUpdate.kt index 9fa544832c..6d07ed5db5 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/EditChannelPostUpdate.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/EditChannelPostUpdate.kt @@ -1,10 +1,10 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.update import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier -import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.CommonMessage import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseEditMessageUpdate data class EditChannelPostUpdate( override val updateId: UpdateIdentifier, - override val data: Message + override val data: CommonMessage<*> ) : BaseEditMessageUpdate diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/EditMessageUpdate.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/EditMessageUpdate.kt index ea9b4b8be9..6062b9d672 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/EditMessageUpdate.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/EditMessageUpdate.kt @@ -1,10 +1,10 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.update import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier -import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.CommonMessage import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseEditMessageUpdate data class EditMessageUpdate( override val updateId: UpdateIdentifier, - override val data: Message + override val data: CommonMessage<*> ) : BaseEditMessageUpdate diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/RawUpdate.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/RawUpdate.kt index 1c77a0e4ca..f96d60bdb2 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/RawUpdate.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/RawUpdate.kt @@ -4,7 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.CallbackQuery.RawCallbac import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.ChosenInlineResult.RawChosenInlineResult import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.query.RawInlineQuery import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier -import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.* import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer import com.github.insanusmokrassar.TelegramBotAPI.types.payments.PreCheckoutQuery import com.github.insanusmokrassar.TelegramBotAPI.types.payments.ShippingQuery @@ -21,11 +21,11 @@ internal data class RawUpdate constructor( @SerialName(updateIdField) val updateId: UpdateIdentifier, @Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class) - private val edited_message: Message? = null, + private val edited_message: CommonMessage<*>? = null, @Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class) private val message: Message? = null, @Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class) - private val edited_channel_post: Message? = null, + private val edited_channel_post: CommonMessage<*>? = null, @Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class) private val channel_post: Message? = null, private val inline_query: RawInlineQuery? = null, diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/BaseEditMessageUpdate.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/BaseEditMessageUpdate.kt index c7ce6ea1b0..9b1ab9cf9d 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/BaseEditMessageUpdate.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/BaseEditMessageUpdate.kt @@ -1,3 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts -interface BaseEditMessageUpdate : BaseMessageUpdate +import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.CommonMessage + +interface BaseEditMessageUpdate : BaseMessageUpdate { + override val data: CommonMessage<*> +}