From b22d8a5a25a595a5d8a5cba8a7f56a4e4002304f Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 25 Feb 2020 13:45:32 +0600 Subject: [PATCH] ForwardFromChannelInfo#channelChat now is ChannelChat --- CHANGELOG.md | 1 + .../TelegramBotAPI/types/message/ForwardInfo.kt | 3 ++- .../TelegramBotAPI/types/message/RawMessage.kt | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eded29891c..cc85a69bb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * `TelegramBotAPI`: * All suspend functions for `RequestsExecutor` was removed (due to replacement into [TelegramBotAPI extensions project](TelegramBotAPI-extensions-api/README.md)) + * `ForwardFromChannelInfo#channelChat` now is `ChannelChat` instead of `Chat` * `TelegramBotAPI-extensions-api`: * Most part of sending media messages functions was removed and replaced with their `InputFile` args analogs diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/ForwardInfo.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/ForwardInfo.kt index 662987f39a..4ca379de2e 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/ForwardInfo.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/ForwardInfo.kt @@ -1,6 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.ChannelChat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat @Deprecated( @@ -52,6 +53,6 @@ typealias ForwardedFromChannelMessage = ForwardFromChannelInfo data class ForwardFromChannelInfo( override val dateOfOriginal: TelegramDate, val messageId: MessageIdentifier, - val channelChat: Chat, + val channelChat: ChannelChat, val signature: String? = null ) : ForwardInfo() diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/RawMessage.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/RawMessage.kt index 6b833e32c6..b1a0cad11f 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/RawMessage.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/RawMessage.kt @@ -142,7 +142,7 @@ internal data class RawMessage( forward_date, forward_sender_name ) - forward_from_chat != null -> ForwardFromChannelInfo( + forward_from_chat is ChannelChat -> ForwardFromChannelInfo( forward_date, forward_from_message_id ?: throw IllegalStateException("Channel forwarded message must contain message id, but was not"), forward_from_chat,