mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-01 22:40:07 +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 linkedChatIdField = "linked_chat_id"
|
||||||
const val horizontalAccuracyField = "horizontal_accuracy"
|
const val horizontalAccuracyField = "horizontal_accuracy"
|
||||||
const val revokeMessagesField = "revoke_messages"
|
const val revokeMessagesField = "revoke_messages"
|
||||||
|
const val messageAutoDeleteTimeField = "message_auto_delete_time"
|
||||||
|
|
||||||
const val requestContactField = "request_contact"
|
const val requestContactField = "request_contact"
|
||||||
const val requestLocationField = "request_location"
|
const val requestLocationField = "request_location"
|
||||||
|
@ -1,10 +1,23 @@
|
|||||||
package dev.inmo.tgbotapi.types.message.ChatEvents
|
package dev.inmo.tgbotapi.types.message.ChatEvents
|
||||||
|
|
||||||
|
import com.soywiz.klock.hours
|
||||||
import dev.inmo.tgbotapi.types.Seconds
|
import dev.inmo.tgbotapi.types.Seconds
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.*
|
||||||
|
import dev.inmo.tgbotapi.types.messageAutoDeleteTimeField
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
private val seconds24Hours: Seconds = 60 * 60 * 24
|
||||||
|
private val seconds7Days: Seconds = seconds24Hours * 7
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class MessageAutoDeleteTimerChanged(
|
data class MessageAutoDeleteTimerChanged(
|
||||||
|
@SerialName(messageAutoDeleteTimeField)
|
||||||
val newAutoDeleteTime: Seconds // TODO:: check that it is seconds
|
val newAutoDeleteTime: Seconds // TODO:: check that it is seconds
|
||||||
) : ChannelEvent, GroupEvent, SupergroupEvent
|
) : ChannelEvent, GroupEvent, SupergroupEvent
|
||||||
|
|
||||||
|
val MessageAutoDeleteTimerChanged.is24Hours
|
||||||
|
get() = newAutoDeleteTime == seconds24Hours
|
||||||
|
|
||||||
|
val MessageAutoDeleteTimerChanged.is7Days
|
||||||
|
get() = newAutoDeleteTime == seconds7Days
|
||||||
|
Loading…
Reference in New Issue
Block a user