mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-15 21:29:25 +00:00
MessageThreadId is value class now
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -148,7 +148,7 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
|
||||
val (chatId, threadId) = splitted
|
||||
ChatIdWithThreadId(
|
||||
chatId.toLongOrNull() ?: return@let null,
|
||||
threadId.toLongOrNull() ?: return@let null
|
||||
threadId.toLongOrNull() ?.let(::MessageThreadId) ?: return@let null
|
||||
)
|
||||
} else {
|
||||
null
|
||||
|
@@ -10,7 +10,6 @@ import kotlinx.serialization.encoding.Encoder
|
||||
import kotlin.jvm.JvmInline
|
||||
|
||||
typealias Identifier = Long
|
||||
typealias MessageThreadId = Long
|
||||
typealias MessageIdentifier = MessageId
|
||||
typealias InlineQueryIdentifier = String
|
||||
typealias UpdateIdentifier = Long
|
||||
|
@@ -0,0 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlin.jvm.JvmInline
|
||||
|
||||
@Serializable
|
||||
@JvmInline
|
||||
value class MessageThreadId(
|
||||
val long: Long
|
||||
)
|
Reference in New Issue
Block a user