mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
add support of inaccessible message
This commit is contained in:
parent
14756fd6e8
commit
5190f7b856
@ -287,6 +287,13 @@ internal data class RawMessage(
|
||||
}
|
||||
|
||||
val asMessage: Message by lazy {
|
||||
if (date.date == 0L) {
|
||||
return@lazy InaccessibleMessage(
|
||||
chat,
|
||||
messageId
|
||||
)
|
||||
}
|
||||
|
||||
try {
|
||||
chatEvent?.let { chatEvent ->
|
||||
when (chat) {
|
||||
|
@ -19,6 +19,15 @@ interface Message : WithPreviewChatAndMessageId {
|
||||
val date: DateTime
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class InaccessibleMessage(
|
||||
override val chat: PreviewChat,
|
||||
override val messageId: MessageId,
|
||||
) : Message {
|
||||
override val date: DateTime
|
||||
get() = DateTime.invoke(0L)
|
||||
}
|
||||
|
||||
data class UnknownMessageType(
|
||||
override val messageId: MessageId,
|
||||
override val chat: PreviewChat,
|
||||
|
Loading…
Reference in New Issue
Block a user