1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +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 com.soywiz.klock.DateTime
import dev.inmo.tgbotapi.types.MediaGroupIdentifier import dev.inmo.tgbotapi.types.MediaGroupIdentifier
import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage 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>( data class ChannelMediaGroupMessage<T : MediaGroupContent>(
override val messageId: MessageId, override val messageId: MessageId,
override val threadId: MessageThreadId?,
override val chat: Chat, override val chat: Chat,
override val date: DateTime, override val date: DateTime,
override val mediaGroupId: MediaGroupIdentifier, override val mediaGroupId: MediaGroupIdentifier,

View File

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

View File

@ -270,6 +270,7 @@ internal data class RawMessage(
when (from) { when (from) {
null -> ChannelMediaGroupMessage( null -> ChannelMediaGroupMessage(
messageId, messageId,
messageThreadId,
chat, chat,
date.asDate, date.asDate,
it, it,
@ -282,6 +283,7 @@ internal data class RawMessage(
) )
else -> CommonMediaGroupMessage( else -> CommonMediaGroupMessage(
messageId, messageId,
messageThreadId,
from, from,
chat, chat,
date.asDate, date.asDate,

View File

@ -1,8 +1,10 @@
package dev.inmo.tgbotapi.types.message.abstracts package dev.inmo.tgbotapi.types.message.abstracts
import dev.inmo.tgbotapi.types.MediaGroupIdentifier import dev.inmo.tgbotapi.types.MediaGroupIdentifier
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
interface MediaGroupMessage<T : MediaGroupContent> : CommonMessage<T> { interface MediaGroupMessage<T : MediaGroupContent> : CommonMessage<T> {
val mediaGroupId: MediaGroupIdentifier val mediaGroupId: MediaGroupIdentifier
val threadId: MessageThreadId?
} }