From cb688a7831630a9d9a640a206a937c00e3e64001 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 9 Mar 2021 19:45:19 +0600 Subject: [PATCH] include message_auto_delete_timer_change --- .../ChatEvents/MessageAutoDeleteTimerChanged.kt | 10 ++++++++++ .../dev/inmo/tgbotapi/types/message/RawMessage.kt | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/MessageAutoDeleteTimerChanged.kt diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/MessageAutoDeleteTimerChanged.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/MessageAutoDeleteTimerChanged.kt new file mode 100644 index 0000000000..b87f4718bc --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/MessageAutoDeleteTimerChanged.kt @@ -0,0 +1,10 @@ +package dev.inmo.tgbotapi.types.message.ChatEvents + +import dev.inmo.tgbotapi.types.Seconds +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChatEvent +import kotlinx.serialization.Serializable + +@Serializable +data class MessageAutoDeleteTimerChanged( + val newAutoDeleteTime: Seconds // TODO:: check that it is seconds +) : ChatEvent diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt index d3b204c2ba..2d3ebdc703 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt @@ -87,6 +87,9 @@ internal data class RawMessage( private val voice_chat_ended: VoiceChatEnded? = null, private val voice_chat_participants_invited: VoiceChatParticipantsInvited? = null, + // AutoDelete Message time changed + private val message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged? = null, + // login property private val connected_website: String? = null, @@ -179,6 +182,7 @@ internal data class RawMessage( new_chat_title != null -> NewChatTitle(new_chat_title) new_chat_photo != null -> NewChatPhoto(new_chat_photo.toList()) voice_chat_started != null -> voice_chat_started + message_auto_delete_timer_changed != null -> message_auto_delete_timer_changed voice_chat_ended != null -> voice_chat_ended voice_chat_participants_invited != null -> voice_chat_participants_invited delete_chat_photo -> DeleteChatPhoto()