2023-01-14 16:37:56 +00:00
|
|
|
package dev.inmo.tgbotapi.libraries.resender
|
|
|
|
|
2023-02-11 14:43:22 +00:00
|
|
|
import dev.inmo.tgbotapi.types.FullChatIdentifierSerializer
|
2023-01-14 16:37:56 +00:00
|
|
|
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
|
|
|
import dev.inmo.tgbotapi.types.MessageId
|
|
|
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
|
|
|
import dev.inmo.tgbotapi.types.message.abstracts.PossiblyMediaGroupMessage
|
|
|
|
import kotlinx.serialization.Serializable
|
|
|
|
|
|
|
|
@Serializable
|
|
|
|
data class MessageMetaInfo(
|
2023-02-11 14:43:22 +00:00
|
|
|
@Serializable(FullChatIdentifierSerializer::class)
|
2023-01-14 16:37:56 +00:00
|
|
|
val chatId: IdChatIdentifier,
|
|
|
|
val messageId: MessageId,
|
|
|
|
val group: String? = null
|
|
|
|
)
|
|
|
|
|
|
|
|
operator fun MessageMetaInfo.Companion.invoke(
|
|
|
|
message: Message
|
|
|
|
) = MessageMetaInfo(message.chat.id, message.messageId, (message as? PossiblyMediaGroupMessage<*>) ?.mediaGroupId)
|