mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-11-07 12:23:14 +00:00
MessageThreadId is value class now
This commit is contained in:
1 parent
4a1989fb79
commit
3c8dbe70dc
8 files changed
+1342
-1286
No files matched your search
@@ -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