1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 12:08:43 +00:00

now PassportMessage contains user too

This commit is contained in:
InsanusMokrassar 2021-01-17 15:35:25 +06:00
parent a2ae4f71de
commit 6dcdc2ab7f
2 changed files with 5 additions and 1 deletions

View File

@ -2,13 +2,16 @@ package dev.inmo.tgbotapi.types.message
import com.soywiz.klock.DateTime import com.soywiz.klock.DateTime
import dev.inmo.tgbotapi.types.MessageIdentifier import dev.inmo.tgbotapi.types.MessageIdentifier
import dev.inmo.tgbotapi.types.User
import dev.inmo.tgbotapi.types.chat.abstracts.Chat import dev.inmo.tgbotapi.types.chat.abstracts.Chat
import dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage
import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.passport.PassportData import dev.inmo.tgbotapi.types.passport.PassportData
data class PassportMessage( data class PassportMessage(
override val messageId: MessageIdentifier, override val messageId: MessageIdentifier,
override val chat: Chat, override val chat: Chat,
override val user: User,
override val date: DateTime, override val date: DateTime,
val passportData: PassportData val passportData: PassportData
) : Message ) : Message, FromUserMessage

View File

@ -329,6 +329,7 @@ internal data class RawMessage(
PassportMessage( PassportMessage(
messageId, messageId,
chat, chat,
from ?: error("For passport must be provided user, but got null"),
date.asDate, date.asDate,
passport_data passport_data
) )