commonMain.com.github.insanusmokrassar.TelegramBotAPI.requests.ForwardMessage.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of TelegramBotAPI-jvm Show documentation
Show all versions of TelegramBotAPI-jvm Show documentation
Library for Object-Oriented and type-safe work with Telegram Bot API
package com.github.insanusmokrassar.TelegramBotAPI.requests
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.MessageAction
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.PossiblyForwardedMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import kotlinx.serialization.*
private val AbleToBeForwardedMessageDeserializer = TelegramBotAPIMessageDeserializationStrategyClass()
@Serializable
data class ForwardMessage(
@SerialName(fromChatIdField)
val fromChatId: ChatIdentifier,
@SerialName(chatIdField)
val toChatId: ChatIdentifier,
@SerialName(messageIdField)
override val messageId: MessageIdentifier,
@SerialName(disableNotificationField)
val disableNotification: Boolean = false
): SimpleRequest, MessageAction {
override val chatId: ChatIdentifier
get() = fromChatId
override fun method(): String = "forwardMessage"
override val resultDeserializer: DeserializationStrategy
get() = AbleToBeForwardedMessageDeserializer
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}