1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

add support of message thread id in media group messages

This commit is contained in:
InsanusMokrassar 2022-11-06 14:10:09 +06:00
parent 867a46d397
commit 1ed620df85
4 changed files with 7 additions and 0 deletions

View File

@ -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<T : MediaGroupContent>(
override val messageId: MessageId,
override val threadId: MessageThreadId?,
override val chat: Chat,
override val date: DateTime,
override val mediaGroupId: MediaGroupIdentifier,

View File

@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
data class CommonMediaGroupMessage<T : MediaGroupContent>(
override val messageId: MessageId,
override val threadId: MessageThreadId?,
override val from: User,
override val chat: Chat,
override val date: DateTime,

View File

@ -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,

View File

@ -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<T : MediaGroupContent> : CommonMessage<T> {
val mediaGroupId: MediaGroupIdentifier
val threadId: MessageThreadId?
}