From 1ed620df85c33e518237fc0cbe8fab9e09b6a463 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 6 Nov 2022 14:10:09 +0600 Subject: [PATCH] add support of message thread id in media group messages --- .../dev/inmo/tgbotapi/types/message/ChannelMediaGroupMessage.kt | 2 ++ .../dev/inmo/tgbotapi/types/message/CommonMediaGroupMessage.kt | 1 + .../kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt | 2 ++ .../inmo/tgbotapi/types/message/abstracts/MediaGroupMessage.kt | 2 ++ 4 files changed, 7 insertions(+) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelMediaGroupMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelMediaGroupMessage.kt index 859e4415b3..a1ca55e721 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelMediaGroupMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelMediaGroupMessage.kt @@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.types.message import com.soywiz.klock.DateTime import dev.inmo.tgbotapi.types.MediaGroupIdentifier import dev.inmo.tgbotapi.types.MessageId +import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage @@ -11,6 +12,7 @@ import dev.inmo.tgbotapi.types.message.content.MediaGroupContent data class ChannelMediaGroupMessage( override val messageId: MessageId, + override val threadId: MessageThreadId?, override val chat: Chat, override val date: DateTime, override val mediaGroupId: MediaGroupIdentifier, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/CommonMediaGroupMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/CommonMediaGroupMessage.kt index ea544158d6..175feb8f2a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/CommonMediaGroupMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/CommonMediaGroupMessage.kt @@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.types.message.content.MediaGroupContent data class CommonMediaGroupMessage( override val messageId: MessageId, + override val threadId: MessageThreadId?, override val from: User, override val chat: Chat, override val date: DateTime, 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 4b390034b2..319a5931aa 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 @@ -270,6 +270,7 @@ internal data class RawMessage( when (from) { null -> ChannelMediaGroupMessage( messageId, + messageThreadId, chat, date.asDate, it, @@ -282,6 +283,7 @@ internal data class RawMessage( ) else -> CommonMediaGroupMessage( messageId, + messageThreadId, from, chat, date.asDate, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/MediaGroupMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/MediaGroupMessage.kt index faac6c32eb..d9dcc74d49 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/MediaGroupMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/MediaGroupMessage.kt @@ -1,8 +1,10 @@ package dev.inmo.tgbotapi.types.message.abstracts import dev.inmo.tgbotapi.types.MediaGroupIdentifier +import dev.inmo.tgbotapi.types.MessageThreadId import dev.inmo.tgbotapi.types.message.content.MediaGroupContent interface MediaGroupMessage : CommonMessage { val mediaGroupId: MediaGroupIdentifier + val threadId: MessageThreadId? }