mirror of
https://github.com/InsanusMokrassar/PlaguPoster.git
synced 2025-09-15 21:19:30 +00:00
complete timer plugin
This commit is contained in:
@@ -1,15 +1,27 @@
|
||||
package dev.inmo.plaguposter.common
|
||||
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.FullChatIdentifierSerializer
|
||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class ChatConfig(
|
||||
@SerialName("targetChat")
|
||||
val targetChatId: ChatId,
|
||||
@Serializable(FullChatIdentifierSerializer::class)
|
||||
val targetChatId: IdChatIdentifier,
|
||||
@SerialName("sourceChat")
|
||||
val sourceChatId: ChatId,
|
||||
@Serializable(FullChatIdentifierSerializer::class)
|
||||
val sourceChatId: IdChatIdentifier,
|
||||
@SerialName("cacheChat")
|
||||
val cacheChatId: ChatId
|
||||
)
|
||||
@Serializable(FullChatIdentifierSerializer::class)
|
||||
val cacheChatId: IdChatIdentifier
|
||||
) {
|
||||
fun check(chatId: IdChatIdentifier) = when (chatId) {
|
||||
targetChatId,
|
||||
sourceChatId,
|
||||
cacheChatId -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user