All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.MessageMetaInfo.kt Maven / Gradle / Ivy

There is a newer version: 0.26.1
Show newest version
package dev.inmo.tgbotapi.libraries.resender

import dev.inmo.tgbotapi.types.FullChatIdentifierSerializer
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(
    @Serializable(FullChatIdentifierSerializer::class)
    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)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy