mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-26 03:58:44 +00:00
fixes for MessageAutoDeleteTimerChanged
This commit is contained in:
parent
8bb60bea34
commit
bc21a680bc
@ -163,6 +163,7 @@ const val ipAddressField = "ip_address"
|
||||
const val linkedChatIdField = "linked_chat_id"
|
||||
const val horizontalAccuracyField = "horizontal_accuracy"
|
||||
const val revokeMessagesField = "revoke_messages"
|
||||
const val messageAutoDeleteTimeField = "message_auto_delete_time"
|
||||
|
||||
const val requestContactField = "request_contact"
|
||||
const val requestLocationField = "request_location"
|
||||
|
@ -1,10 +1,23 @@
|
||||
package dev.inmo.tgbotapi.types.message.ChatEvents
|
||||
|
||||
import com.soywiz.klock.hours
|
||||
import dev.inmo.tgbotapi.types.Seconds
|
||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.messageAutoDeleteTimeField
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
private val seconds24Hours: Seconds = 60 * 60 * 24
|
||||
private val seconds7Days: Seconds = seconds24Hours * 7
|
||||
|
||||
@Serializable
|
||||
data class MessageAutoDeleteTimerChanged(
|
||||
@SerialName(messageAutoDeleteTimeField)
|
||||
val newAutoDeleteTime: Seconds // TODO:: check that it is seconds
|
||||
) : ChannelEvent, GroupEvent, SupergroupEvent
|
||||
|
||||
val MessageAutoDeleteTimerChanged.is24Hours
|
||||
get() = newAutoDeleteTime == seconds24Hours
|
||||
|
||||
val MessageAutoDeleteTimerChanged.is7Days
|
||||
get() = newAutoDeleteTime == seconds7Days
|
||||
|
Loading…
Reference in New Issue
Block a user