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

MessageCallbackQuery#message now is ContentMessage<MessageContent>

This commit is contained in:
InsanusMokrassar 2022-01-06 13:54:22 +06:00
parent fbed81a1b3
commit e1c94f772d
4 changed files with 12 additions and 6 deletions

View File

@ -2,6 +2,9 @@
## 0.38.1
* `Core`:
* `MessageCallbackQuery` (and all implementers as well) has changed the type of `message`: now it is `ContentMessage<MessageContent>` instead of `Message`
## 0.38.0
_This update contains [Telegram Bot API 5.6](https://core.telegram.org/bots/api-changelog#december-30-2021) implementation_

View File

@ -1,7 +1,8 @@
package dev.inmo.tgbotapi.types.CallbackQuery
import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent
sealed interface MessageCallbackQuery : CallbackQuery {
val message: Message
val message: ContentMessage<MessageContent>
}

View File

@ -2,12 +2,13 @@ package dev.inmo.tgbotapi.types.CallbackQuery
import dev.inmo.tgbotapi.types.CallbackQueryIdentifier
import dev.inmo.tgbotapi.types.User
import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent
data class MessageDataCallbackQuery(
override val id: CallbackQueryIdentifier,
override val from: User,
override val chatInstance: String,
override val message: Message,
override val message: ContentMessage<MessageContent>,
override val data: String
) : DataCallbackQuery, MessageCallbackQuery

View File

@ -1,8 +1,9 @@
package dev.inmo.tgbotapi.types.CallbackQuery
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.abstracts.*
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@ -13,7 +14,7 @@ internal data class RawCallbackQuery(
@SerialName(fromField)
val from: User,
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
val message: Message? = null,
val message: ContentMessage<MessageContent>? = null,
@SerialName(inlineMessageIdField)
val inlineMessageId: InlineMessageIdentifier? = null,
@SerialName("chat_instance")